templates.presentation
Class IssuesViewer

java.lang.Object
  extended by templates.presentation.IssuesViewer
All Implemented Interfaces:
ides.api.plugin.presentation.Presentation, java.awt.event.MouseListener, java.util.EventListener, TemplateDiagramSubscriber

public class IssuesViewer
extends java.lang.Object
implements ides.api.plugin.presentation.Presentation, TemplateDiagramSubscriber, java.awt.event.MouseListener

The UI element displaying the list of consistency issues in template designs.

Author:
Lenko Grigorov

Nested Class Summary
protected  class IssuesViewer.IssueRenderer
          Renderer of UI elements for consistency issues when shown as items in a list.
protected  class IssuesViewer.IssueUI
          The UI element which displays an individual consistency issue.
 
Field Summary
protected  javax.swing.DefaultListModel data
          The ListModel used to display the list of consistency issues.
protected  TemplateDiagram diagram
          The template diagram with the design whose consistency issues are displayed.
protected  javax.swing.JList issues
          The list of consistency issues.
 
Constructor Summary
IssuesViewer(TemplateDiagram diagram)
          Construct and set up a UI element to display the list of consistency issues in the template design from the given template diagram.
 
Method Summary
 void addIssuesListener(javax.swing.event.ListDataListener ldl)
          Subscribe a listener for changes to the list of consistency issues.
 void forceRepaint()
           
 javax.swing.JComponent getGUI()
           
 int getIssueCount()
          Retrieve the number of consistency issues in the list.
 ides.api.plugin.model.DESModel getModel()
           
 java.lang.String getName()
           
 void mouseClicked(java.awt.event.MouseEvent e)
          When the user clicks inside the list of consistency issues, select in the template diagram those diagram elements which contribute to the occurrence of the consistency issue under the mouse cursor.
 void mouseEntered(java.awt.event.MouseEvent e)
          Do nothing.
 void mouseExited(java.awt.event.MouseEvent e)
          Do nothing.
 void mousePressed(java.awt.event.MouseEvent e)
          Do nothing.
 void mouseReleased(java.awt.event.MouseEvent e)
          Do nothing.
protected  void refreshIssueList()
          Update the list of consistency issues to reflect the current state of the template design.
 void release()
           
 void removeIssuesListener(javax.swing.event.ListDataListener ldl)
          Cancel the subscription of a listener for changes to the list of consistency issues.
 void setTrackModel(boolean arg0)
           
 void templateDiagramChanged(TemplateDiagramMessage message)
          Update the list of consistency issues after a change to the template diagram.
 void templateDiagramSelectionChanged(TemplateDiagramMessage message)
          After a change to the selection of diagram elements, in the list of consistency issues select those consistency issues which stem from the diagram elements selected by the user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

diagram

protected TemplateDiagram diagram
The template diagram with the design whose consistency issues are displayed.


issues

protected javax.swing.JList issues
The list of consistency issues.


data

protected javax.swing.DefaultListModel data
The ListModel used to display the list of consistency issues.

Constructor Detail

IssuesViewer

public IssuesViewer(TemplateDiagram diagram)
Construct and set up a UI element to display the list of consistency issues in the template design from the given template diagram.

Parameters:
diagram - the template diagram with the design whose consistency issues will be displayed
Method Detail

addIssuesListener

public void addIssuesListener(javax.swing.event.ListDataListener ldl)
Subscribe a listener for changes to the list of consistency issues.

Parameters:
ldl - the listener to be subscribed

removeIssuesListener

public void removeIssuesListener(javax.swing.event.ListDataListener ldl)
Cancel the subscription of a listener for changes to the list of consistency issues.

Parameters:
ldl - the listener whose subscription is to be cancelled

getIssueCount

public int getIssueCount()
Retrieve the number of consistency issues in the list.

Returns:
the number of consistency issues in the list

forceRepaint

public void forceRepaint()
Specified by:
forceRepaint in interface ides.api.plugin.presentation.Presentation

getGUI

public javax.swing.JComponent getGUI()
Specified by:
getGUI in interface ides.api.plugin.presentation.Presentation

getModel

public ides.api.plugin.model.DESModel getModel()
Specified by:
getModel in interface ides.api.plugin.presentation.Presentation

getName

public java.lang.String getName()
Specified by:
getName in interface ides.api.plugin.presentation.Presentation

release

public void release()
Specified by:
release in interface ides.api.plugin.presentation.Presentation

setTrackModel

public void setTrackModel(boolean arg0)
Specified by:
setTrackModel in interface ides.api.plugin.presentation.Presentation

refreshIssueList

protected void refreshIssueList()
Update the list of consistency issues to reflect the current state of the template design. As well, update the consistency status of the template diagram elements.


templateDiagramChanged

public void templateDiagramChanged(TemplateDiagramMessage message)
Update the list of consistency issues after a change to the template diagram.

Specified by:
templateDiagramChanged in interface TemplateDiagramSubscriber
Parameters:
message - the description of the change

templateDiagramSelectionChanged

public void templateDiagramSelectionChanged(TemplateDiagramMessage message)
After a change to the selection of diagram elements, in the list of consistency issues select those consistency issues which stem from the diagram elements selected by the user. This lets the user easily determine which consistency issues depend on a given diagram element.

Specified by:
templateDiagramSelectionChanged in interface TemplateDiagramSubscriber
Parameters:
message - the description of the new collection of selected DiagramElements

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
When the user clicks inside the list of consistency issues, select in the template diagram those diagram elements which contribute to the occurrence of the consistency issue under the mouse cursor. As well, handle the clicking of the mouse over a button with a fix action.

In case there is no consistency issue item under the mouse cursor, do nothing.

Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Do nothing.

Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Do nothing.

Specified by:
mouseExited in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Do nothing.

Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Do nothing.

Specified by:
mouseReleased in interface java.awt.event.MouseListener