de.uni_paderborn.fujaba.fsa.swing
Class DiagramKindComboBoxModel

java.lang.Object
  extended byde.uni_paderborn.fujaba.fsa.swing.DiagramKindComboBoxModel
All Implemented Interfaces:
javax.swing.ComboBoxModel, javax.swing.ListModel

public class DiagramKindComboBoxModel
extends java.lang.Object
implements javax.swing.ComboBoxModel

comboBoxModel for UMLVisibility

Version:
$Revision: 1.19.2.2 $
Author:
$Author: cschneid $

Constructor Summary
DiagramKindComboBoxModel()
          Default Constructor
 
Method Summary
 void addListDataListener(javax.swing.event.ListDataListener l)
          Add a listener to the list that's notified each time a change to the data model occurs.
protected  void fireContentsChanged(java.lang.Object source, int index0, int index1)
          Call this method after one or more elements of the list change (uml-assocs are created or deleted).
protected  void fireIntervalAdded(java.lang.Object source, int index0, int index1)
          Call this method after one or more elements are added to the model (uml-assocs are created).
protected  void fireIntervalRemoved(java.lang.Object source, int index0, int index1)
          Call this method after one or more elements are removed from the model (uml-assocs are removed).
static java.lang.Class getDiagramKindClass(int index)
          Query class of a diagram kind.
static int getDiagramKindIndex(java.lang.Class diagramClass)
          Query index of a diagram kind.
 java.lang.Object getElementAt(int index)
          Get the elementAt attribute of the DiagramKindComboBoxModel object
static java.lang.String getIconPath(int diagramKind)
          Query icon path for a given diagram kind registered with registerDiagramKind(java.lang.Class, java.lang.String, java.lang.String).
static java.lang.String getName(int diagramKind)
          Query name for a given diagram kind registered with registerDiagramKind(java.lang.Class, java.lang.String, java.lang.String).
 java.lang.Object getSelectedItem()
          Get the selectedItem attribute of the DiagramKindComboBoxModel object
 int getSize()
          Get the size attribute of the DiagramKindComboBoxModel object
static int registerDiagramKind(java.lang.Class diagramClass, java.lang.String icon, java.lang.String name)
          Register a diagram kind that can be used with DiagramUsage.
 void removeListDataListener(javax.swing.event.ListDataListener l)
          Remove a listener from the list that's notified each time a change to the data model occurs.
 void setSelectedItem(java.lang.Object value)
          Sets the selectedItem attribute of the DiagramKindComboBoxModel object
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DiagramKindComboBoxModel

public DiagramKindComboBoxModel()
Default Constructor

Method Detail

getIconPath

public static java.lang.String getIconPath(int diagramKind)
Query icon path for a given diagram kind registered with registerDiagramKind(java.lang.Class, java.lang.String, java.lang.String).

Parameters:
diagramKind - index returned by registerDiagramKind(java.lang.Class, java.lang.String, java.lang.String)
Returns:
path to an icon

getName

public static java.lang.String getName(int diagramKind)
Query name for a given diagram kind registered with registerDiagramKind(java.lang.Class, java.lang.String, java.lang.String).

Parameters:
diagramKind - index returned by registerDiagramKind(java.lang.Class, java.lang.String, java.lang.String)
Returns:
name of the diagram kind

getDiagramKindIndex

public static int getDiagramKindIndex(java.lang.Class diagramClass)
Query index of a diagram kind. Attention: indices depend on order of registration - don't use them for persistency

Parameters:
diagramClass - class of the diagram
Returns:
index returned by registerDiagramKind(java.lang.Class, java.lang.String, java.lang.String)

getDiagramKindClass

public static java.lang.Class getDiagramKindClass(int index)
Query class of a diagram kind.

Parameters:
index - index returned by registerDiagramKind(java.lang.Class, java.lang.String, java.lang.String)
Returns:
class of the diagram

registerDiagramKind

public static int registerDiagramKind(java.lang.Class diagramClass,
                                      java.lang.String icon,
                                      java.lang.String name)
Register a diagram kind that can be used with DiagramUsage.

Parameters:
diagramClass - class of the diagram
icon - path to an icon displayed for the diagram kind
name - short name for the diagram kind
Returns:
index of the newly registed kind (may changed after restarting fujaba!)

getSelectedItem

public java.lang.Object getSelectedItem()
Get the selectedItem attribute of the DiagramKindComboBoxModel object

Specified by:
getSelectedItem in interface javax.swing.ComboBoxModel
Returns:
The selectedItem value

setSelectedItem

public void setSelectedItem(java.lang.Object value)
Sets the selectedItem attribute of the DiagramKindComboBoxModel object

Specified by:
setSelectedItem in interface javax.swing.ComboBoxModel
Parameters:
value - The new selectedItem value

getElementAt

public java.lang.Object getElementAt(int index)
Get the elementAt attribute of the DiagramKindComboBoxModel object

Specified by:
getElementAt in interface javax.swing.ListModel
Parameters:
index - No description provided
Returns:
The elementAt value

getSize

public int getSize()
Get the size attribute of the DiagramKindComboBoxModel object

Specified by:
getSize in interface javax.swing.ListModel
Returns:
The size value

addListDataListener

public void addListDataListener(javax.swing.event.ListDataListener l)
Add a listener to the list that's notified each time a change to the data model occurs.

Specified by:
addListDataListener in interface javax.swing.ListModel
Parameters:
l - the ListDataListener

removeListDataListener

public void removeListDataListener(javax.swing.event.ListDataListener l)
Remove a listener from the list that's notified each time a change to the data model occurs.

Specified by:
removeListDataListener in interface javax.swing.ListModel
Parameters:
l - the ListDataListener

fireContentsChanged

protected void fireContentsChanged(java.lang.Object source,
                                   int index0,
                                   int index1)
Call this method after one or more elements of the list change (uml-assocs are created or deleted). The changed elements are specified by a closed interval index0, index1, i.e. the range that includes both index0 and index1. Note that index0 need not be less than or equal to index1.

Parameters:
source - The ListModel that changed, typically "this".
index0 - One end of the new interval.
index1 - The other end of the new interval.
See Also:
EventListenerList, DefaultListModel

fireIntervalAdded

protected void fireIntervalAdded(java.lang.Object source,
                                 int index0,
                                 int index1)
Call this method after one or more elements are added to the model (uml-assocs are created). The new elements are specified by a closed interval index0, index1, i.e. the range that includes both index0 and index1. Note that index0 need not be less than or equal to index1.

Parameters:
source - The ListModel that changed, typically "this".
index0 - One end of the new interval.
index1 - The other end of the new interval.
See Also:
EventListenerList, DefaultListModel

fireIntervalRemoved

protected void fireIntervalRemoved(java.lang.Object source,
                                   int index0,
                                   int index1)
Call this method after one or more elements are removed from the model (uml-assocs are removed). The new elements are specified by a closed interval index0, index1, i.e. the range that includes both index0 and index1. Note that index0 need not be less than or equal to index1.

Parameters:
source - The ListModel that changed, typically "this".
index0 - One end of the new interval.
index1 - The other end of the new interval.
See Also:
EventListenerList, DefaultListModel

toString

public java.lang.String toString()
Returns:
short string representation of current object