Rational Developer for Power Systems Software
V7.6

com.ibm.etools.systems.application.visual.editor.editpolicies
Class ApplicationModelCanonicalConnectionEditPolicy

java.lang.Object
  extended by CanonicalConnectionEditPolicy
      extended by com.ibm.etools.systems.application.visual.editor.editpolicies.AggregateCanonicalConnectionEditPolicy
          extended by com.ibm.etools.systems.application.visual.editor.editpolicies.ApplicationModelCanonicalConnectionEditPolicy

public class ApplicationModelCanonicalConnectionEditPolicy
extends AggregateCanonicalConnectionEditPolicy

Canonical editpolicy for ApplicationModel in Application Diagram.


Nested Class Summary
static class ApplicationModelCanonicalConnectionEditPolicy.ConnectorInfo
           
 
Field Summary
static String copyright
           
 
Constructor Summary
ApplicationModelCanonicalConnectionEditPolicy()
          Constructor.
 
Method Summary
protected  boolean applyTo(Object modelElement)
          Return true if given modelElement should be shown.
protected  List createOperationSet()
           
protected  Request createTargetRequest()
           
 void deactivate()
           
protected  void expandSoleCollapsableChild()
          If there is only one collapable editpart in the children, expand it.
protected  Set getConnectionEditParts()
          Get all connections in the diagram.
protected  String getDefaultFactoryHint()
          Return default factory hint.
protected  SystemModelElementFilterProxy getFilterProxy()
          Get current activated model element filter descriptor.
protected  List getOperationSet()
          Return the list of editparts considered the operation set after caching them
protected  List getSemanticChildrenList()
           
protected  List getSemanticConnectionsList()
          Return semantic connections list.
protected  EObject getSourceElement(EObject relationship)
          Return source element for a given relationship.
protected  EObject getTargetElement(EObject relationship)
          Return target element for a given relationship.
protected  Request getTargetRequest()
          Gets a request to be addressed to the operation set
protected  boolean hasAttachment(View view)
          Return true if the View has connection with other views.
protected  boolean hasCollapsedParent(IGraphicalEditPart endEP)
          Check if the given editpart is a child of collapsed parent.
protected  boolean isInMemoryModel()
          Check if current ApplicationModel is created on the fly.
protected  boolean isOrphan(Artifact modelElement)
          Check if the given element is orphan, ie, not the source or target of any relationship
protected  boolean isRelatedSemanticRelationship(Relationship relation)
          Check if the given Relationship semantic element is related with the host.
protected  boolean needToExpand(ICollapsableEditPart elementEditPart)
          Check if the given editpart should be expanded.
protected  void refreshConnections(Collection existingLinks)
          Refresh connections.
protected  void refreshOnActivate()
          Override to apply default filter.
protected  void refreshSemantic()
          Refresh semantic children.
 void setFilter(String filterID)
          Set view filter.
protected  void setFilterProxy(SystemModelElementFilterProxy filterProxy)
          Get current activated model element filter descriptor.
protected  boolean shouldDeleteView(View view)
          Return true if view can be deleted, false otherwise.
protected  boolean shouldHandleNotificationEvent(Notification event)
          Return true if the canonical edit policy should handle the notification, false otherwise.
protected  boolean shouldIncludeConnection(Edge connector, Collection children)
          Return true if connection should be included, false otherwise.
protected  boolean shouldShowAggregateConnection(AggregateConnectionEditPart connEP)
          Check if the given editpart should be displayed, given the both end are visible.
 void updateFigureVisibility()
          Update visibility of children nodes and connections.
 
Methods inherited from class com.ibm.etools.systems.application.visual.editor.editpolicies.AggregateCanonicalConnectionEditPolicy
computeLinksFromSemanticModel, createAggregatedConnection, createAggregatedConnectionCommand, createConnections, createDirectConnection, findViewForSemanticElement, getAggregatedSemanticElement, getAncestor, getApplicationModel, getCollapsedChecker, getConnectionView, getDiagram, getEditPartFor, getEditPartFor, getExistDirectConnection, getExistingAggregateConnection, getExistingDirectConnection, getHighestCollapsedContainer, getHostSemanticElement, getOwningCollapsableEditPart, getSemanticElementToViewRegistry, isCollapsedEditPart, isConnectionReady, isInternalRelation, registerSemanticElementToViewMappings, setSemanticElementToViewRegistry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static final String copyright
See Also:
Constant Field Values
Constructor Detail

ApplicationModelCanonicalConnectionEditPolicy

public ApplicationModelCanonicalConnectionEditPolicy()
Constructor.

Method Detail

getSemanticChildrenList

protected List getSemanticChildrenList()

isOrphan

protected boolean isOrphan(Artifact modelElement)
Check if the given element is orphan, ie, not the source or target of any relationship

Parameters:
modelElement -
Returns:
true if it is orphan, false otherwise.

applyTo

protected boolean applyTo(Object modelElement)
Return true if given modelElement should be shown.

Parameters:
modelElement -
Returns:

shouldDeleteView

protected boolean shouldDeleteView(View view)
Return true if view can be deleted, false otherwise.


hasAttachment

protected boolean hasAttachment(View view)
Return true if the View has connection with other views. False otherwise.


getDefaultFactoryHint

protected String getDefaultFactoryHint()
Return default factory hint.


getSemanticConnectionsList

protected List getSemanticConnectionsList()
Return semantic connections list.

Overrides:
getSemanticConnectionsList in class AggregateCanonicalConnectionEditPolicy

getSourceElement

protected EObject getSourceElement(EObject relationship)
Return source element for a given relationship.

Overrides:
getSourceElement in class AggregateCanonicalConnectionEditPolicy

getTargetElement

protected EObject getTargetElement(EObject relationship)
Return target element for a given relationship.

Overrides:
getTargetElement in class AggregateCanonicalConnectionEditPolicy

shouldIncludeConnection

protected boolean shouldIncludeConnection(Edge connector,
                                          Collection children)
Return true if connection should be included, false otherwise.


refreshOnActivate

protected void refreshOnActivate()
Override to apply default filter.


refreshSemantic

protected void refreshSemantic()
Refresh semantic children. Also refresh connections.


updateFigureVisibility

public void updateFigureVisibility()
Update visibility of children nodes and connections.


shouldShowAggregateConnection

protected boolean shouldShowAggregateConnection(AggregateConnectionEditPart connEP)
Check if the given editpart should be displayed, given the both end are visible.

Parameters:
connEP -
Returns:
true if the aggregate connection should be displayed, false otherwise.

getConnectionEditParts

protected Set getConnectionEditParts()
Get all connections in the diagram.


hasCollapsedParent

protected boolean hasCollapsedParent(IGraphicalEditPart endEP)
Check if the given editpart is a child of collapsed parent.

Parameters:
endEP -
Returns:

expandSoleCollapsableChild

protected void expandSoleCollapsableChild()
If there is only one collapable editpart in the children, expand it.


needToExpand

protected boolean needToExpand(ICollapsableEditPart elementEditPart)
Check if the given editpart should be expanded.

Parameters:
elementEditPart -
Returns:
true if need to expand, false otherwise.

refreshConnections

protected void refreshConnections(Collection existingLinks)
Refresh connections.


isRelatedSemanticRelationship

protected boolean isRelatedSemanticRelationship(Relationship relation)
Check if the given Relationship semantic element is related with the host.

Overrides:
isRelatedSemanticRelationship in class AggregateCanonicalConnectionEditPolicy

getOperationSet

protected final List getOperationSet()
Return the list of editparts considered the operation set after caching them

Returns:
A list of editparts conidered the operation set

getTargetRequest

protected Request getTargetRequest()
Gets a request to be addressed to the operation set

Returns:
a target request

createTargetRequest

protected Request createTargetRequest()

createOperationSet

protected List createOperationSet()

setFilter

public void setFilter(String filterID)
Set view filter.


getFilterProxy

protected SystemModelElementFilterProxy getFilterProxy()
Get current activated model element filter descriptor.


setFilterProxy

protected void setFilterProxy(SystemModelElementFilterProxy filterProxy)
Get current activated model element filter descriptor.


shouldHandleNotificationEvent

protected boolean shouldHandleNotificationEvent(Notification event)
Return true if the canonical edit policy should handle the notification, false otherwise.


isInMemoryModel

protected boolean isInMemoryModel()
Check if current ApplicationModel is created on the fly.

Returns:
true if the model is dynamically created, false if the model is loaded from saved diagram file.

deactivate

public void deactivate()
Overrides:
deactivate in class AggregateCanonicalConnectionEditPolicy

Rational Developer for Power Systems Software
V7.6

Copyright © 2011 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.