Class MVToolBar
MVToolBar defines a draggable toolbar that acts as a placeholder of multiple control buttons. Each control button controls an Oracle Maps built-in tool or a custom tool and responses to mouse clicks by invoking event handlers associated with the tool. The toolbar can be displayed in two orientations, vertical or horizontal.
The following built-in tools are supported: Redline tool, Distance tool, Circle tool, Rectangle tool and Marquee Zoom tool. The application can choose to display control buttons for all or some of these built-in tools in the toolbar.
The tool bar can also hold custom tool buttons that controls application defined operations.
A tool button can be defined in one of the following two types:- COMMAND: A command button has only one state, UP, and always reacts to mouse clicks by invoking the same BUTTON_DOWN event listener.
- TOGGLE: A toggle button has two states, DOWN and UP. The initial state of the button is UP. Its state changes to DOWN after it is clicked. It stays DOWN until it is clicked again, after which its state changes to UP. The BUTTON_DOWN event listener is invoked when the button state changes from UP to DOWN. The BUTTON_UP event listener is invoked when the button state changes from DOWN to UP.
- SEPERATOR: A seperator simply displays a static seperator icon that does not react to any user actions.
Multiple buttons can organized as a button group, where at most one button can be in the pushed DOWN state at any time. Pushing down a button will automatically pop up the other pushed DOWN button if there is any. All built-in tool buttons, except the Marquee Zoom button, are TOGGLE buttons organized in the same button group. The Marquee Zoom button is a TOGGLE button, but does not belong to any button group.
Constructor Attributes | Constructor Name and Description |
---|---|
MVToolBar(toolBarID, builtInButtons, orientation)
|
Method Attributes | Method Name and Description |
---|---|
addBuiltInButton(btObject)
This method add a Built-In button to the tool bar.
|
|
addButton(btObject)
This method add a tool button to the tool bar.
|
|
addButtonGroup(group)
This method adds a button group to the tool bar.
|
|
addSeparator(buttonID)
This method internally creates a MVToolButton of SEPARATOR type and adds it to the tool bar.
|
|
getBuiltInButton(tool)
This method gets the specified built-in tool button instance, which has been added to the map toolbar object.
|
|
This method returns the MVButtonGroup object that contains all built-in tool buttons.
|
|
getBuiltInTool(tool)
This method gets the specified built-in tool instance, which has been added to the map toolbar object.
|
|
getButton(itemId)
This method gets a button object from the tool bar.
|
|
This method checks whether the toolbar is visible.
|
|
removeButton(btObject)
This method deletes a button from the tool bar.
|
|
removeButtonGroup(group)
This method removes a button group from the tool bar.
|
|
setPosition(left, top, xOffset, yOffset)
This method sets the position of the map toolbar object.
|
|
setVisible(visible)
This method shows or hides the map toolbar by changing its visibility.
|
- Parameters:
- {String} toolBarID
- A string that specifies the id of the toolbar.
- {array} builtInButtons
- An array that specifies the built-in tool buttons to be included in the tool bar. Each array element specifies one built-in tool bar to be included. It can be one of the following values, MVToolBar.BUILTIN_CIRCLE, MVToolBar.BUILTIN_RECTANGLE, MVToolBar.BUILTIN_REDLINE, MVToolBar.BUILTIN_DISTANCE, MVToolBar.BUILTIN_MARQUEE_ZOOM, MVToolBar.BUILTIN_ALL. To include all built-in tool buttons, you can use an array with a single MVToolBar.BUILTIN_ALL element.
- {int} orientation
- This parameter specifies the orientation of the tool bar. It can be MVToolBar.VERTICAL or MVToolBar.HORIZONTAL.
- Returns:
- The newly created MVDistanceTool object.
- Parameters:
- {MVToolButton} btObject
- btObject specifies the button object to be added.
- Returns:
- None
- Parameters:
- {MVToolButton} btObject
- btObject specifies the button object to be added.
- Returns:
- None
- Parameters:
- {MVButtonGroup} group
- a MVButtonGroup object that specifies the button group.
- Returns:
- None
- Parameters:
- {string} buttonID
- buttonID specifies the id of the newly created SEPARATOR button. This id is used to delete this SEPARATOR button if needed.
- Returns:
- None
- Parameters:
- {int} tool
- tool specifies the built-in tool button to be returned. It can be one of the following values: MVToolBar.BUILTIN_CLEAR, MVToolBar.BUILTIN_CIRCLE, MVToolBar.BUILTIN_RECTANGLE, MVToolBar.BUILTIN_REDLINE, MVToolBar.BUILTIN_DISTANCE MVToolBar.BUILTIN_MARQUEE_ZOOM.
- Returns:
- the built-in tool button instance
- Returns:
- None
- Parameters:
- {int} tool
- tool specifies the built-in tool to be returned. It can be one of the following values: MVToolBar.BUILTIN_CIRCLE, MVToolBar.BUILTIN_RECTANGLE, MVToolBar.BUILTIN_REDLINE, or MVToolBar.BUILTIN_DISTANCE.
- Returns:
- the built-in tool instance
- Parameters:
- {string} itemId
- itemId specifies the id of the button.
- Returns:
- button object
- Returns:
- a boolean the specifies whether the toolbar is visible.
- Parameters:
- {MVToolButton} btObject
- btObject specifies the button object to be deleted.
- Returns:
- None
- Parameters:
- {MVButtonGroup} group
- a MVButtonGroup object that specifies the button group.
- Returns:
- None
The vertical position is specified by parameter top, which should be a float number in the range of 0-1. The absolute offset of the toolbar object center from the top map window border in pixels is top*map_window_height.
- Parameters:
- {float} left
- left specifies the horizontal position of the map toolbar object relative to the left border of the map window.
- {float} top
- top specifies the vertical position of the map toolbar object relative to the top border of the map window.
- {int} xOffset
- xOffset is an integer that specifies the horizontal offset in pixels
- {int} yOffset
- yOffset is an integer that specifies the vertical offset in pixels
- Returns:
- None
- Parameters:
- {Boolean} visible
- visible is a Boolean value that specifies whether the toolbar should be visible. It can be true(visible) or false(not visible).
- Returns:
- None