org.andromda.metafacades.emf.uml22.FrontEndPseudostateLogicImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of andromda-metafacades-emf-uml22 Show documentation
Show all versions of andromda-metafacades-emf-uml22 Show documentation
The Eclipse EMF UML2 v2.X metafacades. This is the set of EMF UML2 2.X metafacades
implementations. These implement the common UML metafacades for .uml model files.
The newest version!
package org.andromda.metafacades.emf.uml22;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import org.andromda.metafacades.uml.ActivityGraphFacade;
import org.andromda.metafacades.uml.FrontEndAction;
import org.andromda.metafacades.uml.FrontEndActivityGraph;
import org.andromda.metafacades.uml.FrontEndForward;
import org.andromda.metafacades.uml.FrontEndUseCase;
import org.andromda.metafacades.uml.StateMachineFacade;
import org.andromda.metafacades.uml.TransitionFacade;
import org.andromda.metafacades.uml.UseCaseFacade;
/**
* MetafacadeLogic implementation for
* org.andromda.metafacades.uml.FrontEndPseudostate.
*
* @see org.andromda.metafacades.uml.FrontEndPseudostate
*/
public class FrontEndPseudostateLogicImpl
extends FrontEndPseudostateLogic
{
private static final long serialVersionUID = -4265098437803642987L;
/**
* @param metaObject
* @param context
*/
public FrontEndPseudostateLogicImpl(
final Object metaObject,
final String context)
{
super(metaObject, context);
}
/**
* @see org.andromda.metafacades.uml.FrontEndPseudostate#isContainedInFrontEndUseCase()
*/
@Override
protected boolean handleIsContainedInFrontEndUseCase()
{
return this.getStateMachine() instanceof FrontEndActivityGraph;
}
/**
* @see org.andromda.metafacades.uml.FrontEndPseudostate#getContainerActions()
*/
@Override
protected List handleGetContainerActions()
{
final Collection actionSet = new LinkedHashSet();
final StateMachineFacade graphContext = this.getStateMachine();
if (graphContext instanceof ActivityGraphFacade)
{
final UseCaseFacade useCase = ((ActivityGraphFacade)graphContext).getUseCase();
if (useCase instanceof FrontEndUseCase)
{
for (final Iterator actionIterator = ((FrontEndUseCase)useCase).getActions().iterator();
actionIterator.hasNext();)
{
final FrontEndAction action = actionIterator.next();
final List transitions = action.getTransitions();
for (final Iterator transitionIterator = transitions.iterator(); transitionIterator.hasNext();)
{
final TransitionFacade transition = (TransitionFacade)transitionIterator.next();
if (this.equals(transition.getTarget()))
{
actionSet.add(action);
}
}
}
}
}
return new ArrayList(actionSet);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy