venice
Class ZInterface

java.lang.Object
  |
  +--edu.umd.cs.jazz.ZSceneGraphObject
        |
        +--edu.umd.cs.jazz.ZNode
              |
              +--edu.umd.cs.jazz.ZLeaf
                    |
                    +--edu.umd.cs.jazz.ZVisualLeaf
                          |
                          +--venice.ZVisualLeafModelElement
                                |
                                +--venice.ZInterface
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable, VInterface, VModelElement, edu.umd.cs.jazz.io.ZSerializable

public class ZInterface
extends ZVisualLeafModelElement
implements VInterface

ZInterface is a concrete implementation of VInterface using Jazz library.

Author:
Hannu Laurila, Antti Pietarinen
See Also:
Serialized Form

Field Summary
private static double CIRCLE_SIZE
          size of the circle in pixels from left to right (not radius!)
private  edu.umd.cs.jazz.component.ZLabel mExpandedInterfaceLabel
          visual component representing the label for interface
private  edu.umd.cs.jazz.component.ZText mExpandedInterfaceOpsText
          visual component representing the operations list text area
private  edu.umd.cs.jazz.component.ZRectangle mExpandedInterfaceRectangle
          visual component representing the class rectangle
private  edu.umd.cs.jazz.component.ZLine mExpandedInterfaceSeparator
          visual component representing the line between name and operations
private  edu.umd.cs.jazz.component.ZLabel mExpandedInterfaceStereoLabel
          visual component representing the <> label
private  java.util.LinkedList mHiddenRelationships
          list of relationships to this interface which are hidden currently
private  edu.umd.cs.jazz.component.ZEllipse mInterfaceEllipse
          visual component representing the circle
private  edu.umd.cs.jazz.component.ZLabel mInterfaceLabel
          visual component representing the label under the circle
private  int mInterfaceType
          type of the interface, one of the TYPE_ constants
private  java.lang.Object[] mOperations
          operations of the interface as an array. toString() method is used to get a String representation
private  java.util.LinkedList mSubsDeps
          list of dependencies greated to substitute this interface when hidden.
private  int mViewMode
          view mode of the interface, one of the VIEWMODE_constants.
 
Fields inherited from class venice.ZVisualLeafModelElement
mCompositeRelationships, mHiddenOfferedRealizations, mModelElementId, mModelElementName, mModelElementType, mModelElementVisible, mOfferedRealizationSubstitutions, mOriginalRelationships, mRequiredInterfaceSubstitutions, mRequiredRealizations
 
Fields inherited from class edu.umd.cs.jazz.ZVisualLeaf
cacheVolatile, visualComponents
 
Fields inherited from class edu.umd.cs.jazz.ZNode
clientProperties, editorFactory, findable, findable_DEFAULT, hasNodeListener, hasNodeListener_DEFAULT, parent, pickable, pickable_DEFAULT, savable, savable_DEFAULT, selectable, selectable_DEFAULT
 
Fields inherited from class edu.umd.cs.jazz.ZSceneGraphObject
bounds, inClone, listenerList, objRefTable, volatileBounds, volatileBounds_DEFAULT
 
Fields inherited from interface venice.VInterface
TYPE_OFFERED, TYPE_REQUIRED, VIEWMODE_CIRCLE, VIEWMODE_EXPANDED
 
Constructor Summary
ZInterface(java.lang.String inId)
          Constructor.
 
Method Summary
 void addSubsDeps(VModelElement inElement)
          Add parameter to the list.
 void clearHiddenRelationships()
          Clear hidden relationship list.
protected  void dataChanged()
          dataChanged() is called when model element data is changed. subclasses should override this method with a method which modifies the component appearance according to data changes.
 java.util.LinkedList getHiddenRelationships()
          Gets content of hidden relationship list.
 int getInterfaceType()
          returns the type of interface (offered or required)
 java.lang.Object[] getOperations()
          returns the array which contains the operations in this interface.
 java.awt.geom.Point2D getRelationshipConnectPoint()
          get the point where relationships should be attached to.
 java.util.LinkedList getSubsDeps()
          Gets content of substitute dependency list.
 int getViewMode()
          returns the current view mode of the interface.
 java.awt.geom.Point2D intersectWithLine(java.awt.geom.Line2D inLine)
          Intersect this visualization element with a line.
 void removeSubsDeps()
          Clear all elements from substitute dependency list.
 void setHiddenRelationships(VModelElement inElement)
          Sets parameter to hidden relationship list
 void setInterfaceType(int inType)
          sets the type of the interface (offered or required).
 void setOperations(java.lang.Object[] inOps)
          sets the operations of the interface.
 void setViewMode(int inMode)
          sets the view mode of the interface.
 
Methods inherited from class venice.ZVisualLeafModelElement
addRelationship, addToCompositeRelationshipList, addToHiddenOfferedRealizations, addToOfferedRealizationSubstitutions, addToRequiredInterfaceSubstitutions, addToRequiredRealizations, clearHiddenOfferedRealizations, clearOfferedRealizationSubstitutions, clearRequiredInterfaceSubstitutions, clearRequiredRealizations, debugDump, getCompositeRelationships, getHiddenOfferedRealizations, getId, getName, getOfferedRealizationSubstitutions, getRelationships, getRequiredInterfaceSubstitutions, getRequiredRealizations, getType, getVisible, getVParent, setName, setType, setVisible
 
Methods inherited from class edu.umd.cs.jazz.ZVisualLeaf
addVisualComponent, addVisualComponents, clearVisualComponents, computeBounds, duplicateObject, getFirstVisualComponent, getNumVisualComponents, getVisualComponent, getVisualComponentBounds, getVisualComponentGlobalBounds, getVisualComponents, getVolatileBounds, indexOf, pick, removeVisualComponent, render, setState, setVisualComponent, setVisualComponent, trimToSize, updateObjectReferences, updateVolatility, writeObject, writeObject, writeObjectRecurse
 
Methods inherited from class edu.umd.cs.jazz.ZNode
, addClientProperty, addNodeListener, dump, editor, extract, findNodes, getClientProperty, getGlobalBounds, getGlobalToLocalTransform, getLocalToGlobalTransform, getParent, getRoot, globalToLocal, globalToLocal, hasNodeListener, isAncestorOf, isDescendentOf, isFindable, isPickable, isSavable, isSelectable, localToGlobal, localToGlobal, lower, lowerTo, percolateEventUpSceneGraph, putClientProperty, raise, raiseTo, remove, removeNodeListener, repaint, repaint, repaint, reparent, replaceWith, setEditorFactory, setFindable, setParent, setPickable, setSavable, setSelectable, updateBounds, writeReplace
 
Methods inherited from class edu.umd.cs.jazz.ZSceneGraphObject
addMouseListener, addMouseMotionListener, clone, fireEvent, fireMouseEvent, getBounds, getBoundsReference, getListenerList, hasLisenerOfType, hasMouseListener, processMouseEvent, removeEventListener, removeMouseListener, removeMouseMotionListener, reshape, setBounds, setVolatileBounds
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 
Methods inherited from interface venice.VModelElement
addRelationship, addToCompositeRelationshipList, debugDump, getCompositeRelationships, getId, getName, getRelationships, getType, getVisible, getVParent, setName, setType, setVisible
 

Field Detail

CIRCLE_SIZE

private static final double CIRCLE_SIZE
size of the circle in pixels from left to right (not radius!)

mInterfaceType

private int mInterfaceType
type of the interface, one of the TYPE_ constants

mViewMode

private int mViewMode
view mode of the interface, one of the VIEWMODE_constants.

mOperations

private java.lang.Object[] mOperations
operations of the interface as an array. toString() method is used to get a String representation

mInterfaceLabel

private edu.umd.cs.jazz.component.ZLabel mInterfaceLabel
visual component representing the label under the circle

mInterfaceEllipse

private edu.umd.cs.jazz.component.ZEllipse mInterfaceEllipse
visual component representing the circle

mExpandedInterfaceOpsText

private edu.umd.cs.jazz.component.ZText mExpandedInterfaceOpsText
visual component representing the operations list text area

mExpandedInterfaceStereoLabel

private edu.umd.cs.jazz.component.ZLabel mExpandedInterfaceStereoLabel
visual component representing the <> label

mExpandedInterfaceLabel

private edu.umd.cs.jazz.component.ZLabel mExpandedInterfaceLabel
visual component representing the label for interface

mExpandedInterfaceRectangle

private edu.umd.cs.jazz.component.ZRectangle mExpandedInterfaceRectangle
visual component representing the class rectangle

mExpandedInterfaceSeparator

private edu.umd.cs.jazz.component.ZLine mExpandedInterfaceSeparator
visual component representing the line between name and operations

mSubsDeps

private java.util.LinkedList mSubsDeps
list of dependencies greated to substitute this interface when hidden.

mHiddenRelationships

private java.util.LinkedList mHiddenRelationships
list of relationships to this interface which are hidden currently
Constructor Detail

ZInterface

public ZInterface(java.lang.String inId)
Constructor.
Parameters:
inId - model element id
Method Detail

addSubsDeps

public void addSubsDeps(VModelElement inElement)
Add parameter to the list.
Specified by:
addSubsDeps in interface VInterface
Parameters:
inElement -  

removeSubsDeps

public void removeSubsDeps()
Clear all elements from substitute dependency list.
Specified by:
removeSubsDeps in interface VInterface

setHiddenRelationships

public void setHiddenRelationships(VModelElement inElement)
Sets parameter to hidden relationship list
Specified by:
setHiddenRelationships in interface VInterface
Parameters:
inElement -  

getHiddenRelationships

public java.util.LinkedList getHiddenRelationships()
Gets content of hidden relationship list.
Specified by:
getHiddenRelationships in interface VInterface
Returns:
mHiddenRelationships

clearHiddenRelationships

public void clearHiddenRelationships()
Clear hidden relationship list.
Specified by:
clearHiddenRelationships in interface VInterface

getSubsDeps

public java.util.LinkedList getSubsDeps()
Gets content of substitute dependency list.
Specified by:
getSubsDeps in interface VInterface
Returns:
mSubsDeps

getInterfaceType

public int getInterfaceType()
Description copied from interface: VInterface
returns the type of interface (offered or required)
Specified by:
getInterfaceType in interface VInterface
Following copied from interface: venice.VInterface
Returns:
one of TYPE_ constants

getOperations

public java.lang.Object[] getOperations()
Description copied from interface: VInterface
returns the array which contains the operations in this interface.

The array has been given to VInterface using setOperations method. See setOperations method description for information on the array content

Specified by:
getOperations in interface VInterface

getViewMode

public int getViewMode()
Description copied from interface: VInterface
returns the current view mode of the interface.
Specified by:
getViewMode in interface VInterface
Following copied from interface: venice.VInterface
Returns:
one of VIEWMODE_ constants

setInterfaceType

public void setInterfaceType(int inType)
Description copied from interface: VInterface
sets the type of the interface (offered or required). The type affects the way how the interface is visualized. An offered interface is visualised as a filled circle and a required interface is visualized as an empty circle
Specified by:
setInterfaceType in interface VInterface

setOperations

public void setOperations(java.lang.Object[] inOps)
Description copied from interface: VInterface
sets the operations of the interface.

The operations are shown when the interface is visualized in expanded mode.

Specified by:
setOperations in interface VInterface
Following copied from interface: venice.VInterface
Parameters:
inOps - the array of objects representing the operations of the interface. The objects toString() method is used to get string representation of the operations

setViewMode

public void setViewMode(int inMode)
Description copied from interface: VInterface
sets the view mode of the interface.
Specified by:
setViewMode in interface VInterface
Following copied from interface: venice.VInterface
Parameters:
inMode - one of VIEWMODE_ constants

dataChanged

protected void dataChanged()
Description copied from class: ZVisualLeafModelElement
dataChanged() is called when model element data is changed. subclasses should override this method with a method which modifies the component appearance according to data changes.
Overrides:
dataChanged in class ZVisualLeafModelElement

getRelationshipConnectPoint

public java.awt.geom.Point2D getRelationshipConnectPoint()
Description copied from interface: VModelElement
get the point where relationships should be attached to. Probably element center. This method cannot return null.
Specified by:
getRelationshipConnectPoint in interface VModelElement
Following copied from interface: venice.VModelElement
Returns:
the point for relationships to attach to

intersectWithLine

public java.awt.geom.Point2D intersectWithLine(java.awt.geom.Line2D inLine)
Description copied from interface: VModelElement
Intersect this visualization element with a line. If these graphic elements don't intersect, null is returned.
Specified by:
intersectWithLine in interface VModelElement
Following copied from interface: venice.VModelElement
Parameters:
inLine - the line to calculate intersection with
Returns:
the point of intersection or null