public class IlvDashboardInteractor extends IlvManagerViewInteractor
IlvDashboardInteractor
is a subclassed manager view interactor
that processes IlvDashboardDiagram
events.
This class manages the following:
IlvDashboardSymbol
objects
If an IlvDashboardKeySelectManager
is attached to the
dashboard diagram, this interactor invokes the applicable focus selection
functions that follow the mouse click or arrow key events it receives.
IlvDashboardInteractor
object and attach it
to the dashboard diagram view. The following code example shows how this is
done:
public void perform(ActionEvent e, IlvDiagrammer diagrammer) throws Exception { IlvDashboardDiagram source = (IlvDashboardDiagram) diagrammer; IlvDashboardContext context = new IlvDashboardContext(); IlvDashboardDiagram dashboard = new IlvDashboardDiagram(context); ... // Build the DOM DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.newDocument(); Element dashboardDOM = IlvDashboardDOM.buildDashboardDOM(document, source); document.appendChild(dashboardDOM); // Read the contents IlvDashboardDOM.readDashboardDOM(dashboard, document); // Manage view interactor dashboard.getView().setInteractor(new IlvDashboardInteractor()); // To manage the keyboard focus-like selection dashboard.setSelectManager(new IlvDashboardKeySelectManager(dashboard)); ... }
Constructor and Description |
---|
IlvDashboardInteractor()
Constructs a dashboard interactor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
attach(IlvManagerView v)
Sets the mouse cursor and adds a listener to the view added to this
IlvDashboardInteractor instance. |
protected void |
detach()
Sets the mouse cursor and removes the listener added to this
IlvDashboardInteractor instance. |
IlvDashboardDiagram |
getDiagram()
Returns the dashboard diagram attached to this interactor.
|
protected void |
processEvent(AWTEvent evt)
Handles navigation and focus events by selecting the symbol clicked or
moving the focus to the next symbol when keyboard navigation arrows are
pressed.
|
protected void |
processFocusEvent(FocusEvent event)
Call this method when the dashboard diagram attached to this selector
gains the focus.
|
protected boolean |
processFocusKeyEvent(KeyEvent event)
Selects the next symbol in the selection chain in function of the key
pressed by the user.
|
protected void |
processMouseEvent(MouseEvent event)
Processes a mouse event by setting the focus on the dashboard diagram
selected by the user or opening a window displaying a dashboard diagram linked
to the symbol clicked by the user.
|
protected void |
showDashboard(String urlString)
Opens a window that displays the dashboard diagram read from a dashboard
file.
|
addFocusListener, addKeyListener, addMouseListener, addMouseMotionListener, allowEnsureVisible, allowEnsureVisible, disableEvents, drawGhost, drawGhost, enableEvents, ensureVisible, ensureVisible, getManager, getManagerView, getTransformer, handleExpose, isXORGhost, processKeyEvent, processMouseMotionEvent, removeFocusListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, setXORGhost
public IlvDashboardInteractor()
public IlvDashboardDiagram getDiagram()
IlvDashboardInteractor
overview.,
How to use a
IlvDashboardInteractor
protected void attach(IlvManagerView v)
IlvDashboardInteractor
instance.attach
in class IlvManagerViewInteractor
v
- The view added to this IlvDashboardInteractor
instance.detach()
protected void detach()
IlvDashboardInteractor
instance.detach
in class IlvManagerViewInteractor
attach(IlvManagerView)
protected void processEvent(AWTEvent evt)
processEvent
in class IlvManagerViewInteractor
evt
- The mouse or keyboard event to be handled.processFocusKeyEvent(KeyEvent)
protected boolean processFocusKeyEvent(KeyEvent event)
Pressing the UP or RIGHT key selects the next symbol, pressing the DOWN or LEFT key selects the previous symbol in the selection chain.
event
- The keyboard event to be handled.true
if the event is processed by this function.processEvent(AWTEvent)
protected void processFocusEvent(FocusEvent event)
processFocusEvent
in class IlvManagerViewInteractor
event
- The mouse event to be handled.processEvent(AWTEvent)
,
processFocusKeyEvent(KeyEvent)
,
processMouseEvent(MouseEvent)
protected void processMouseEvent(MouseEvent event)
IlvManagerViewInteractor
.processMouseEvent
in class IlvManagerViewInteractor
event
- The mouse event to be handled.IlvDashboardKeySelectManager
,
showDashboard(String)
,
IlvManagerViewInteractor
protected void showDashboard(String urlString)
urlString
. This dashboard diagram is displayed in a
Swing JFrame component. If the given urlString
null or
a blank string, this method does nothing.urlString
- A URL pointing to a dashboard diagram file.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.