Search this API

y.view
Class NavigationComponent

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by y.view.NavigationComponent
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class NavigationComponent
extends javax.swing.JPanel

This component provides several controls to navigate inside a graph. The component consists of two main control groups named navigation controls and zoom controls. The navigation controls consist of 4 button, that provide a scroll functionality and one button to fit the graph content to the view. The zoom controls consist of a zoom slider and two buttons to zoom in and zoom out. One can define the alignment of both control groups to each other using method setOrientation(byte). The fit content button inside the navigation controls can be disabled using method setShowFitContentButton(boolean). Furthermore the zoom in and zoom out buttons can be hidden setShowZoomButtons(boolean). The step size used for the navigation buttons can be determined using method setScrollStepSize(double). By default this step size is 10 pixels for zoom level 1 and the step size will scale with the zoom level. This can be disabled using method setConsiderZoomLevel(boolean). When using the scroll buttons of the navigation controls, one can determine the repeat timer delay of those buttons by setting client property CLIENT_PROPERTY_KEY_SCROLL_TIMER_DELAY JComponent.putClientProperty(Object, Object) (e.g. to new Integer(60) which is default). Accordingly the initial timer delay can be set CLIENT_PROPERTY_KEY_SCROLL_TIMER_INITIAL_DELAY. (e.g. to new Integer(300), which is default). When using the zoom buttons of the zoom controls, one can determine the repeat timer delay of those buttons by setting client property CLIENT_PROPERTY_KEY_ZOOM_TIMER_DELAY JComponent.putClientProperty(Object, Object) (e.g. to new Integer(60) which is default). Accordingly the initial timer delay can be set CLIENT_PROPERTY_KEY_ZOOM_TIMER_INITIAL_DELAY. (e.g. to new Integer(300), which is default). When using the fit content button setShowFitContentButton(boolean) one can determine whether the view transformation shall be animated or not by setting client property "NavigationComponent.AnimateFitContent". By default the animation is not enabled. JComponent.putClientProperty(Object, Object) to Boolean.TRUE;

See Also:
Serialized Form
 

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static java.lang.String CLIENT_PROPERTY_KEY_SCROLL_TIMER_DELAY
          Used as key when setting the timer delay client property JComponent.putClientProperty(Object, Object) for the scroll buttons.
static java.lang.String CLIENT_PROPERTY_KEY_SCROLL_TIMER_INITIAL_DELAY
          Used as key when setting the initial timer delay client property JComponent.putClientProperty(Object, Object) for the scroll buttons.
static java.lang.String CLIENT_PROPERTY_KEY_ZOOM_TIMER_DELAY
          Used as key when setting the timer delay client property JComponent.putClientProperty(Object, Object) for the zoom buttons.
static java.lang.String CLIENT_PROPERTY_KEY_ZOOM_TIMER_INITIAL_DELAY
          Used as key when setting the initial timer delay client property JComponent.putClientProperty(Object, Object) for the zoom buttons.
static byte ORIENTATION_BOTTOM_TO_TOP
          Orientation specifier that is used to determine how the navigation controls and the zoom controls are aligned.
static byte ORIENTATION_LEFT_TO_RIGHT
          Orientation specifier that is used to determine how the navigation controls and the zoom controls are aligned.
static byte ORIENTATION_RIGHT_TO_LEFT
          Orientation specifier that is used to determine how the navigation controls and the zoom controls are aligned.
static byte ORIENTATION_TOP_TO_BOTTOM
          Orientation specifier that is used to determine how the navigation controls and the zoom controls are aligned.
protected static byte SCROLL_DIRECTION_DOWN
           
protected static byte SCROLL_DIRECTION_LEFT
           
protected static byte SCROLL_DIRECTION_RIGHT
           
protected static byte SCROLL_DIRECTION_UP
           
protected  Graph2DView view
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
NavigationComponent(Graph2DView view)
           
 
Method Summary
protected  javax.swing.Action createFitContentAction()
          Creates the action that will be assigned to the fit content button createFitContentButton().
protected  javax.swing.JButton createFitContentButton()
          Creates the button in the middle of the navigation controls.
protected  javax.swing.Icon createFitContentIcon()
          This method can be overwritten to return a custom icon for the created fit content action createFitContentAction()
protected  javax.swing.Action createScrollAction(byte direction)
          Creates an action that will scroll the view.
protected  javax.swing.JButton createScrollButton(byte direction)
           
protected  javax.swing.Icon createScrollIcon(byte direction)
          This method can be overwritten to return a custom icon for the created scroll buttons createScrollButton(byte).
protected  javax.swing.Action createZoomAction(boolean zoomIn)
          Creates the action that will be assigned to the zoom buttons createZoomButton(boolean).
protected  javax.swing.JButton createZoomButton(boolean zoomIn)
          Creates the buttons above and below the zoom slider.
protected  javax.swing.Icon createZoomIcon(boolean zoomIn)
          This method can be overwritten to return a custom icon for the created zoom icons createZoomIcon(boolean).
protected  javax.swing.JSlider createZoomSlider(byte orientation)
          Creates the zoom slider that is used to zoom in and out of the graph.
 double getButtonZoomFactor()
          Returns the step size that is used by the zoom buttons to zoom in and out of the view.
 double getMaxZoomLevel()
           
 double getMinZoomLevel()
           
 byte getOrientation()
          Returns an orientation specifier that is used to determine how the navigation controls and the zoom controls are aligned.
 double getScrollStepSize()
          Returns the step size used for the navigation buttons.
 boolean isConsiderZoomLevel()
          Returns whether the navigation scroll buttons shall take the zoom level into account when scrolling.
 boolean isShowFitContentButton()
          Whether the fit content button is shown.
 boolean isShowLabelsOnSlider()
          Returns whether labels and ticks are on the zoom slider.
 boolean isShowNavigationControls()
          Whether or not the navigation controls are shown.
 boolean isShowZoomButtons()
          Whether the zoom in and zoom out buttons are shown.
 boolean isShowZoomSlider()
          Whether the zoom slider is shown or not.
protected  void paintComponent(java.awt.Graphics g)
           
 void setButtonZoomFactor(double factor)
          Sets the steps in which the zoom in and zoom out buttons will zoom the view.
 void setConsiderZoomLevel(boolean considerZoomLevel)
          Determines whether the navigation scroll buttons shall take the zoom level into account when scrolling.
 void setMaxZoomLevel(double maxZoomLevel)
          Sets the maximum zoom level the zoom slider will zoom to.
 void setMinZoomLevel(double minZoomLevel)
          Sets the minimum zoom level the zoom slider will zoom to.
 void setOrientation(byte orientation)
          Sets the orientation specifier that is used to determine how the navigation controls and the zoom controls are aligned.
 void setScrollStepSize(double stepSize)
          Determines the step size used for the navigation buttons.
 void setShowFitContentButton(boolean showFitContentButton)
          Whether the fit content button shall be shown.
 void setShowLabelsOnSlider(boolean showLabels)
          Whether to show labels and ticks on the zoom slider.
 void setShowNavigationControls(boolean showNavigationControls)
          Determines whether or not the navigation controls are shown.
 void setShowZoomButtons(boolean showZoomButtons)
          Determines whether the zoom in and zoom out buttons shall be shown.
 void setShowZoomSlider(boolean showZoomSlider)
          Determines whether the zoom slider shall be shown.
protected  void updateComponents()
          Will fill the main panel with the components specified by the diverse settings.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ORIENTATION_TOP_TO_BOTTOM

public static final byte ORIENTATION_TOP_TO_BOTTOM
Orientation specifier that is used to determine how the navigation controls and the zoom controls are aligned. This option will place the navigation controls above the zoom controls. The zoom slider will be drawn vertical.

See Also:
Constant Field Values

ORIENTATION_LEFT_TO_RIGHT

public static final byte ORIENTATION_LEFT_TO_RIGHT
Orientation specifier that is used to determine how the navigation controls and the zoom controls are aligned. This option will place the navigation controls left to the zoom controls. The zoom slider will be drawn horizontal.

See Also:
Constant Field Values

ORIENTATION_BOTTOM_TO_TOP

public static final byte ORIENTATION_BOTTOM_TO_TOP
Orientation specifier that is used to determine how the navigation controls and the zoom controls are aligned. This option will place the navigation controls below the zoom controls. The zoom slider will be drawn vertical.

See Also:
Constant Field Values

ORIENTATION_RIGHT_TO_LEFT

public static final byte ORIENTATION_RIGHT_TO_LEFT
Orientation specifier that is used to determine how the navigation controls and the zoom controls are aligned. This option will place the navigation controls right to the zoom controls. The zoom slider will be drawn horizontal.

See Also:
Constant Field Values

CLIENT_PROPERTY_KEY_SCROLL_TIMER_DELAY

public static final java.lang.String CLIENT_PROPERTY_KEY_SCROLL_TIMER_DELAY
Used as key when setting the timer delay client property JComponent.putClientProperty(Object, Object) for the scroll buttons. When keeping the button pressed the according action will be triggered continuously. The interval in milli seconds can be set using the client property. Default is 60.

See Also:
Constant Field Values

CLIENT_PROPERTY_KEY_SCROLL_TIMER_INITIAL_DELAY

public static final java.lang.String CLIENT_PROPERTY_KEY_SCROLL_TIMER_INITIAL_DELAY
Used as key when setting the initial timer delay client property JComponent.putClientProperty(Object, Object) for the scroll buttons. The initial delay (in milliseconds) will determine after which period of time the action shall be triggered continuously. Default is 300.

See Also:
Constant Field Values

CLIENT_PROPERTY_KEY_ZOOM_TIMER_DELAY

public static final java.lang.String CLIENT_PROPERTY_KEY_ZOOM_TIMER_DELAY
Used as key when setting the timer delay client property JComponent.putClientProperty(Object, Object) for the zoom buttons. When keeping the button pressed the according action will be triggered continuously. The interval in milli seconds can be set using the client property. Default is 60.

See Also:
Constant Field Values

CLIENT_PROPERTY_KEY_ZOOM_TIMER_INITIAL_DELAY

public static final java.lang.String CLIENT_PROPERTY_KEY_ZOOM_TIMER_INITIAL_DELAY
Used as key when setting the initial timer delay client property JComponent.putClientProperty(Object, Object) for the zoom buttons. The initial delay (in milliseconds) will determine after which period of time the action shall be triggered continuously. Default is 300.

See Also:
Constant Field Values

SCROLL_DIRECTION_UP

protected static final byte SCROLL_DIRECTION_UP
See Also:
Constant Field Values

SCROLL_DIRECTION_DOWN

protected static final byte SCROLL_DIRECTION_DOWN
See Also:
Constant Field Values

SCROLL_DIRECTION_RIGHT

protected static final byte SCROLL_DIRECTION_RIGHT
See Also:
Constant Field Values

SCROLL_DIRECTION_LEFT

protected static final byte SCROLL_DIRECTION_LEFT
See Also:
Constant Field Values

view

protected final Graph2DView view
Constructor Detail

NavigationComponent

public NavigationComponent(Graph2DView view)
Method Detail

paintComponent

protected void paintComponent(java.awt.Graphics g)
Overrides:
paintComponent in class javax.swing.JComponent

updateComponents

protected void updateComponents()
Will fill the main panel with the components specified by the diverse settings.


createScrollButton

protected javax.swing.JButton createScrollButton(byte direction)
Parameters:
direction - the direction to which the created button shall scroll. One of SCROLL_DIRECTION_UP, SCROLL_DIRECTION_DOWN, SCROLL_DIRECTION_LEFT, SCROLL_DIRECTION_RIGHT
Returns:
a button that will perform a scroll action to the given direction with the given step size.
See Also:
createScrollIcon(byte)

createScrollAction

protected javax.swing.Action createScrollAction(byte direction)
Creates an action that will scroll the view.

Parameters:
direction - the direction in which scrolling shall happen.
Returns:
a scroll action that will scroll the view to the given direction

createScrollIcon

protected javax.swing.Icon createScrollIcon(byte direction)
This method can be overwritten to return a custom icon for the created scroll buttons createScrollButton(byte).

Parameters:
direction - the direction to which the created button shall scroll. One of SCROLL_DIRECTION_UP, SCROLL_DIRECTION_DOWN, SCROLL_DIRECTION_LEFT, SCROLL_DIRECTION_RIGHT.
Returns:
an icon that is used for the created scroll buttons.
See Also:
createScrollButton(byte)

createFitContentButton

protected javax.swing.JButton createFitContentButton()
Creates the button in the middle of the navigation controls. The action assigned to this button is determined by createFitContentAction().

Returns:
a JButton that will perform the action determined by createFitContentAction()
See Also:
createFitContentAction(), createFitContentIcon(), setShowFitContentButton(boolean)

createFitContentAction

protected javax.swing.Action createFitContentAction()
Creates the action that will be assigned to the fit content button createFitContentButton(). By default when first triggering this action, it will fit the graph to the current view dimensions and by triggering it a second time, it will zoom back to the previous zoom level and view coordinate. This allows some kind of quick birds-eye view on the graph. The icon of this action can be customized by overwriting createFitContentIcon().

Returns:
the action responsible to fit the content.
See Also:
createFitContentButton(), createFitContentIcon()

createFitContentIcon

protected javax.swing.Icon createFitContentIcon()
This method can be overwritten to return a custom icon for the created fit content action createFitContentAction()

Returns:
an icon that is used for the created fit content button.
See Also:
createFitContentButton()

createZoomButton

protected javax.swing.JButton createZoomButton(boolean zoomIn)
Creates the buttons above and below the zoom slider. The action that will be assigned to these buttons is determined by method createZoomAction(boolean).

Parameters:
zoomIn - whether a zoom in button (true) or a zoom out button (false) shall be created.
Returns:
a JButton that will act as determined by method createZoomAction(boolean).
See Also:
(boolean), createZoomIcon(boolean), setShowZoomButtons(boolean)

createZoomAction

protected javax.swing.Action createZoomAction(boolean zoomIn)
Creates the action that will be assigned to the zoom buttons createZoomButton(boolean). By default an action is returned that will zoom in (if zoomIn is true) or zoom out (if zoomIn is false) of the view. The icon of this action can be customized by overwriting createZoomIcon(boolean).

Parameters:
zoomIn - whether an action shall be created to zoom into the view (true) or out of the view (false)
Returns:
an action that will be assigned to the button created in createZoomButton(boolean)
See Also:
createZoomButton(boolean), createZoomIcon(boolean), setShowZoomButtons(boolean)

createZoomIcon

protected javax.swing.Icon createZoomIcon(boolean zoomIn)
This method can be overwritten to return a custom icon for the created zoom icons createZoomIcon(boolean).

Parameters:
zoomIn - whether an icon for a zoom in button (true) or a zoom out button (false) shall be created.
Returns:
an icon that is used for the created zoom in and zoom out buttons.
See Also:
createZoomButton(boolean)

createZoomSlider

protected javax.swing.JSlider createZoomSlider(byte orientation)
Creates the zoom slider that is used to zoom in and out of the graph.

Parameters:
orientation - the orientation of the main component, that also is used to determine the slider orientation. ORIENTATION_LEFT_TO_RIGHT and ORIENTATION_RIGHT_TO_LEFT will usually lead to a horizontal slider, while ORIENTATION_TOP_TO_BOTTOM and ORIENTATION_BOTTOM_TO_TOP will lead to a vertical slider. The default preferred slider size is set to 100 height (vertical orientation) or 100 width (horizontal orientation).
Returns:
a slider that is used to zoom in and out of the graph.

isShowNavigationControls

public boolean isShowNavigationControls()
Whether or not the navigation controls are shown. The navigation controls consist of the scroll buttons created using method createScrollButton(byte) and a button to fit the content created using createFitContentButton(). By default all navigation controls are shown. One can specify to not show the fit content button using method showFitContentButton.

Returns:
  • true - if the navigation controls are shown (default)
  • false - if the navigation controls are not shown

setShowNavigationControls

public void setShowNavigationControls(boolean showNavigationControls)
Determines whether or not the navigation controls are shown. The navigation controls consist of the scroll buttons created using method createScrollButton(byte) and a button to fit the content created using createFitContentButton(). By default all navigation controls are shown. One can specify to not show the fit content button using method setShowFitContentButton(boolean).

Parameters:
showNavigationControls -
  • true - if the navigation controls shall be shown (default)
  • false - if the navigation controls shall not be shown

isShowFitContentButton

public boolean isShowFitContentButton()
Whether the fit content button is shown. Note: Besides this setting, the navigation controls themselves need to be shown, too.

Returns:
  • true - if the fit content button shall be shown (default)
  • false - if the fit content button shall not be shown
See Also:
setShowNavigationControls(boolean)

setShowFitContentButton

public void setShowFitContentButton(boolean showFitContentButton)
Whether the fit content button shall be shown. Note: Besides this setting, the navigation controls themselves need to be shown, too.

Parameters:
showFitContentButton -
  • true - if the fit content button shall be shown (default)
  • false - if the fit content button shall not be shown
See Also:
setShowNavigationControls(boolean)

isShowZoomButtons

public boolean isShowZoomButtons()
Whether the zoom in and zoom out buttons are shown.

Returns:
  • true - if the zoom buttons are shown (default)
  • false - if the zoom buttons are not shown

setShowZoomButtons

public void setShowZoomButtons(boolean showZoomButtons)
Determines whether the zoom in and zoom out buttons shall be shown.

Parameters:
showZoomButtons -
  • true - if the zoom buttons shall be shown (default)
  • false - if the zoom buttons shall not be shown

isShowZoomSlider

public boolean isShowZoomSlider()
Whether the zoom slider is shown or not.

Returns:
  • true - if the zoom slider is shown (default)
  • false - if the zoom slider is not shown

setShowZoomSlider

public void setShowZoomSlider(boolean showZoomSlider)
Determines whether the zoom slider shall be shown.

Parameters:
showZoomSlider -
  • true - if the zoom slider shall be shown (default)
  • false - if the zoom slider shall not be shown

getScrollStepSize

public double getScrollStepSize()
Returns the step size used for the navigation buttons. By default this step size is 10 pixels. By default the step size will scale with the zoom level.

Returns:
the step size in pixels used for the navigation buttons. If the zoom level is being considered, this method will return the step size for zoom level 1.
See Also:
setConsiderZoomLevel(boolean)

setScrollStepSize

public void setScrollStepSize(double stepSize)
Determines the step size used for the navigation buttons. By default this step size is 10 pixels. By default the step size will scale with the zoom level.

Parameters:
stepSize - the step size that is used for the navigation buttons. If the zoom level is being considered, the step size is taken as the step size for zoom level 1.
See Also:
setConsiderZoomLevel(boolean)

setButtonZoomFactor

public void setButtonZoomFactor(double factor)
Sets the steps in which the zoom in and zoom out buttons will zoom the view. Default is 1.1 which will zoom the view to 1.1 * current zoom for zoom in and 1/1.1 * current zoom for zoom out. If you want to double the zoom at a button click you should set 2.0.

Parameters:
factor - the factor with which to zoom in / zoom out. Must be greater than 1. Default is (1.1). If you want to double the view / divide it by 2 per click, the according value would be 2.
See Also:
setShowZoomButtons(boolean), createZoomButton(boolean)

getButtonZoomFactor

public double getButtonZoomFactor()
Returns the step size that is used by the zoom buttons to zoom in and out of the view.

Returns:
the step size that is used by the zoom buttons to zoom in and out of the view. Default is 0.1.
See Also:
setShowZoomButtons(boolean), createZoomButton(boolean)

setShowLabelsOnSlider

public void setShowLabelsOnSlider(boolean showLabels)
Whether to show labels and ticks on the zoom slider.

Parameters:
showLabels - true if labels shall be shown, false otherwise. Default is false.
See Also:
setShowZoomSlider(boolean), createZoomSlider(byte)

isShowLabelsOnSlider

public boolean isShowLabelsOnSlider()
Returns whether labels and ticks are on the zoom slider.

Returns:
true if labels are shown, false otherwise. Default is false
See Also:
setShowZoomSlider(boolean), createZoomSlider(byte)

setMaxZoomLevel

public void setMaxZoomLevel(double maxZoomLevel)
Sets the maximum zoom level the zoom slider will zoom to.

Parameters:
maxZoomLevel - the maximum zoom level the can be zoomed to using the slider

getMaxZoomLevel

public double getMaxZoomLevel()

setMinZoomLevel

public void setMinZoomLevel(double minZoomLevel)
Sets the minimum zoom level the zoom slider will zoom to.

Parameters:
minZoomLevel - the minimum zoom level that can be zoomed to using the slider

getMinZoomLevel

public double getMinZoomLevel()

getOrientation

public byte getOrientation()
Returns an orientation specifier that is used to determine how the navigation controls and the zoom controls are aligned.

Returns:
One of ORIENTATION_TOP_TO_BOTTOM (default), ORIENTATION_RIGHT_TO_LEFT, ORIENTATION_BOTTOM_TO_TOP, ORIENTATION_LEFT_TO_RIGHT.

setOrientation

public void setOrientation(byte orientation)
Sets the orientation specifier that is used to determine how the navigation controls and the zoom controls are aligned.

Parameters:
orientation - One of ORIENTATION_TOP_TO_BOTTOM (default), ORIENTATION_RIGHT_TO_LEFT, ORIENTATION_BOTTOM_TO_TOP, ORIENTATION_LEFT_TO_RIGHT.

isConsiderZoomLevel

public boolean isConsiderZoomLevel()
Returns whether the navigation scroll buttons shall take the zoom level into account when scrolling. By default this is enabled. The set scroll step size setScrollStepSize(double) will then be increased for zoom levels smaller than "1" and decreased for zoom levels greater than "1".

Returns:
  • true - if the scroll buttons do take the zoom level into account (default)
  • false - if the scroll buttons do not take the zoom level into account

setConsiderZoomLevel

public void setConsiderZoomLevel(boolean considerZoomLevel)
Determines whether the navigation scroll buttons shall take the zoom level into account when scrolling. By default this is enabled. The set scroll step size setScrollStepSize(double) will then be increased for zoom levels smaller than "1" and decreased for zoom levels greater than "1".

Parameters:
considerZoomLevel -
  • true - if the scroll buttons shall take the zoom level into account (default)
  • false - if the scroll buttons shall not take the zoom level into account

© Copyright 2000-2021,
yWorks GmbH.
All rights reserved.