Interface BaseElement

All Superinterfaces:
Cloneable, Comparable
All Known Subinterfaces:
Abstraction, AcceptCallAction, AcceptEventAction, Action, ActionExecutionSpecification, ActionInputPin, Activity, ActivityEdge, ActivityFinalNode, ActivityGroup, ActivityNode, ActivityParameterNode, ActivityPartition, Actor, AddStructuralFeatureValueAction, AddVariableValueAction, AnyReceiveEvent, Artifact, Association, AssociationClass, Behavior, BehavioralFeature, BehavioredClassifier, BehaviorExecutionSpecification, BooleanTaggedValue, BroadcastSignalAction, CallAction, CallBehaviorAction, CallEvent, CallOperationAction, CentralBufferNode, ChangeEvent, Class, Classifier, ClassifierTemplateParameter, Clause, ClearAssociationAction, ClearStructuralFeatureAction, ClearVariableAction, Collaboration, CollaborationUse, CombinedFragment, Comment, CommunicationPath, Component, ComponentRealization, ConditionalNode, ConnectableElement, ConnectableElementTemplateParameter, ConnectionPointReference, Connector, ConnectorEnd, ConsiderIgnoreFragment, Constraint, Continuation, ControlFlow, ControlNode, CreateLinkAction, CreateLinkObjectAction, CreateObjectAction, DataStoreNode, DataType, DecisionNode, Dependency, DeployedArtifact, Deployment, DeploymentSpecification, DeploymentTarget, DestroyLinkAction, DestroyObjectAction, DestructionOccurrenceSpecification, Device, Diagram, DirectedRelationship, Duration, DurationConstraint, DurationInterval, DurationObservation, Element, ElementImport, ElementTaggedValue, ElementValue, EncapsulatedClassifier, Enumeration, EnumerationLiteral, Event, ExceptionHandler, ExecutableNode, ExecutionEnvironment, ExecutionOccurrenceSpecification, ExecutionSpecification, ExpansionNode, ExpansionRegion, Expression, Extend, Extension, ExtensionEnd, ExtensionPoint, Feature, FinalNode, FinalState, FlowFinalNode, ForkNode, FunctionBehavior, Gate, Generalization, GeneralizationSet, GeneralOrdering, Image, Include, InformationFlow, InformationItem, InitialNode, InputPin, InstanceSpecification, InstanceValue, IntegerTaggedValue, Interaction, InteractionConstraint, InteractionFragment, InteractionOperand, InteractionUse, Interface, InterfaceRealization, InterruptibleActivityRegion, Interval, IntervalConstraint, InvocationAction, JoinNode, Lifeline, LinkAction, LinkEndCreationData, LinkEndData, LinkEndDestructionData, LiteralBoolean, LiteralInteger, LiteralNull, LiteralReal, LiteralSpecification, LiteralString, LiteralUnlimitedNatural, LoopNode, Manifestation, MDElement, MDObject, MergeNode, Message, MessageEnd, MessageEvent, MessageOccurrenceSpecification, Model, com.dassault_systemes.modeler.foundation.model.ModelElement, ModelObject, MultiplicityElement, NamedElement, Namespace, Node, ObjectFlow, ObjectNode, Observation, OccurrenceSpecification, OpaqueAction, OpaqueBehavior, OpaqueExpression, Operation, OperationTemplateParameter, OutputPin, Package, PackageableElement, PackageImport, PackageMerge, Parameter, ParameterableElement, ParameterSet, PartDecomposition, Pin, Port, PrimitiveType, Profile, ProfileApplication, Property, ProtocolConformance, ProtocolStateMachine, ProtocolTransition, Pseudostate, QualifierValue, RaiseExceptionAction, ReadExtentAction, ReadIsClassifiedObjectAction, ReadLinkAction, ReadLinkObjectEndAction, ReadLinkObjectEndQualifierAction, ReadSelfAction, ReadStructuralFeatureAction, ReadVariableAction, Realization, RealTaggedValue, Reception, ReclassifyObjectAction, RedefinableElement, RedefinableTemplateSignature, ReduceAction, Region, Relationship, RemoveStructuralFeatureValueAction, RemoveVariableValueAction, ReplyAction, SendObjectAction, SendSignalAction, SequenceNode, Signal, SignalEvent, Slot, StartClassifierBehaviorAction, StartObjectBehaviorAction, State, StateInvariant, StateMachine, Stereotype, StringExpression, StringTaggedValue, StructuralFeature, StructuralFeatureAction, StructuredActivityNode, StructuredClassifier, Substitution, TaggedValue, TemplateableElement, TemplateBinding, TemplateParameter, TemplateParameterSubstitution, TemplateSignature, TestIdentityAction, TimeConstraint, TimeEvent, TimeExpression, TimeInterval, TimeObservation, Transition, Trigger, Type, TypedElement, UnmarshallAction, Usage, UseCase, ValuePin, ValueSpecification, ValueSpecificationAction, Variable, VariableAction, Vertex, WriteLinkAction, WriteStructuralFeatureAction, WriteVariableAction
All Known Implementing Classes:
AbstractDiagramPresentationElement, com.nomagic.magicdraw.uml.symbols.shapes.AbstractHeaderShapeView, com.nomagic.magicdraw.uml.symbols.shapes.AbstractImageShapeView, com.nomagic.magicdraw.uml.symbols.shapes.AbstractSeparatorView, com.nomagic.magicdraw.uml.symbols.shapes.AbstractShapeWithLabels, com.nomagic.magicdraw.uml.symbols.shapes.AbstractShapeWithLabelsInside, com.nomagic.magicdraw.uml.symbols.shapes.AbstractTextBoxView, ActionView, ActivationView, com.nomagic.magicdraw.uml.symbols.shapes.ActivityGroupView, ActorView, ArtifactView, AssociationClassView, AssociationView, BarView, com.nomagic.magicdraw.uml.symbols.paths.BaseFlowView, com.nomagic.magicdraw.uml.symbols.shapes.BaseHeaderShapeView, com.nomagic.magicdraw.uml.symbols.shapes.BaseLifelineView, com.nomagic.magicdraw.uml.symbols.paths.BaseRealizationView, com.nomagic.magicdraw.uml.symbols.shapes.BaseTreeShape, CallBehaviorActionView, CallOperationActionView, ClassifierView, ClassView, CollaborationUseView, CollaborationView, CombinedFragmentView, CommentView, CommunicationPathView, ComponentView, ConditionalNodeView, ConnectorToSelfView, ConnectorView, ConstraintLinkView, com.nomagic.magicdraw.uml.symbols.paths.ContainerLinkView, com.nomagic.magicdraw.uml.symbols.shapes.ContainerShapeView, ContainmentLinkView, ContentShape, ControlFlowView, DataTypeView, DecisionView, DependencyView, DeploymentView, DiagramFrameView, DiagramLegendShape, DiagramPresentationElement, DiagramPropertiesShape, DiagramShape, DurationConstraintView, ElementImportView, com.nomagic.magicdraw.uml.symbols.shapes.EmbeddedImageShapeView, EnumerationView, ExceptionHandlerView, ExpansionNodeView, ExpansionRegionView, ExtendView, ExtensionView, FlowConnectorView, FoundMessageView, com.nomagic.magicdraw.uml.symbols.shapes.FragmentView, com.nomagic.magicdraw.uml.symbols.shapes.FrameView, GeneralizationSetView, GeneralizationView, GenericView, com.dassault_systemes.modeler.magic.kerml.diagram.HeaderShape, com.nomagic.magicdraw.uml.symbols.shapes.HeaderShapeView, ImageShapeView, IncludeView, InformationFlowView, InformationItemView, InstanceSpecificationView, InteractionUseOverviewView, InteractionUseView, InterfaceRealizationView, InterfaceView, InterruptibleActivityRegionView, LifeLineLineView, LifelineView, LinkAttributeView, LinkView, com.nomagic.magicdraw.uml.symbols.paths.LinkWithEndsView, com.nomagic.magicdraw.uml.symbols.paths.LinkWithRolesView, com.nomagic.magicdraw.uml.symbols.paths.LinkWithStereotype, LoopNodeView, com.nomagic.magicdraw.uml.symbols.paths.LostFoundMessageView, LostMessageView, com.nomagic.magicdraw.uml.MDElementImpl, MessageView, NNaryAssociationView, NodeInstanceSpecificationView, NodeView, NoteAnchorView, NoteView, ObjectFlowView, ObjectNodeView, OpaqueActionView, PackageImportView, PackageMergeView, PackageShape, PackageView, PartView, PathConnector, PathElement, com.nomagic.magicdraw.uml.symbols.shapes.PathToSelfShape, PinView, PortView, PresentationElement, PrimitiveTypeView, ProfileApplicationView, Project, ProjectOptions, PseudoNodeView, PseudoStateView, RealizationView, RectangularShape, RoleBindingView, SeparatorView, com.nomagic.magicdraw.uml.symbols.paths.SeqBaseMessageView, SeqMessageView, SeqSelfMessageView, SequenceLifelineView, SequenceNodeView, ShapeElement, com.nomagic.magicdraw.uml.symbols.shapes.ShapeWithLabels, SignalActionView, SignalView, StateInvariantView, StateView, StereotypeView, StructuredActivityNodeView, SwimlaneCellView, SwimlaneView, com.nomagic.magicdraw.uml.symbols.shapes.TableCellView, com.nomagic.magicdraw.uml.symbols.shapes.TableShapeView, TemplateBindingView, TextBoxView, com.nomagic.magicdraw.uml.symbols.shapes.TextShapeView, TimeConstraintView, TransitionToSelfView, TransitionView, TreeView, com.nomagic.magicdraw.uml.symbols.shapes.TypedElementView, com.nomagic.magicdraw.uml.symbols.shapes.TypedElementWithLabels, UsageView, UseCaseView, VirtualRelationView

@OpenApi public interface BaseElement extends Comparable, Cloneable
  • Method Details

    • getID

      @OpenApi String getID()
      Returns the ID of the Element. If the ID is null, new id for an element is generated. Element id is persistence and does not change during project save/load.
      Returns:
      the ID of the Element.
    • sGetID

      @OpenApi String sGetID()
      Returns the actual ID of the Element. May return null if ID was not generated or set for this element.
      Returns:
      the ID of the Element.
      See Also:
    • setID

      @OpenApi void setID(String id)
      Sets the specified ID to the Element.
      Parameters:
      id - the id to be set.
    • getClassType

      @OpenApi Class getClassType()
      Gets the type of the element class. Every element has its own ClassType. Usually this class type is class of element or class interface of an element. All types are registered in ClassTypes.
      Returns:
      the type of the element.
    • addPropertyChangeListener

      @OpenApi void addPropertyChangeListener(PropertyChangeListener listener)
      Registers the listener to the element. The given listener will get notifications about property changes in this element.
      Parameters:
      listener - the PropertyChangeListener to be added.
      See Also:
    • removePropertyChangeListener

      @OpenApi void removePropertyChangeListener(PropertyChangeListener listener)
      Unregisters the given listener from the element. The given listener will not get any notifications about property changes in this element.
      Parameters:
      listener - the PropertyChangeListener to be removed.
      See Also:
    • removeAllPropertyChangeListeners

      void removeAllPropertyChangeListeners()
      Removes all property change listeners from this element.
    • firePropertyChange

      @OpenApi void firePropertyChange(String propertyName, @CheckForNull Object oldValue, @CheckForNull Object newValue)
      Delegates firePropertyChange to the PropertyChangeSupport, the member of this class, which reports a bound property update to any registered listeners. No event is fired if old and new values are equal or null.
      Parameters:
      propertyName - the programmatic name of the property that was changed.
      oldValue - the old value of the property
      newValue - the new value of the property
      See Also:
    • atInsert

      void atInsert()
      This method is called then this element is added into the project.
    • dispose

      @OpenApi void dispose()
      This method is called when an element is removed from the project.
    • accept

      @OpenApi void accept(AbstractVisitor visitor) throws Exception
      Method accepts a visitor, and calls method visit < class name > (this) of visitor.
      Parameters:
      visitor - which visits this element.
      Throws:
      Exception
    • getHumanName

      @OpenApi String getHumanName()
      Returns human representation of the element. Usually human name is constructed from element class type and name.
      Returns:
      the human name of the element.
    • getHumanType

      @OpenApi String getHumanType()
      Returns human representation of the element type. Contains only element type without element name.
      Returns:
      the human type of the element.
    • canAdd

      @OpenApi default boolean canAdd(BaseElement element)
      Checks if this element can add a given element.
      Parameters:
      element - the given element.
      Returns:
      true if this element can add a given element.
      See Also:
    • canAdd

      @OpenApi boolean canAdd(BaseElement element, boolean checkPermissions)
      Checks if this element can add a given element.
      Following rules must be true to have result true:
      1.if checkTeamworkLock == true, this element must be locked for edit.
      2.element can add given element as instance (class types are checked).
      3.element can add given element as child (a given element is not a parent of current element etc.).
      Parameters:
      element - the element to add.
      checkPermissions - check or not permissions.
      Returns:
      true if an element can add the given element as a child.
    • canDeleteChild

      boolean canDeleteChild(BaseElement child)
      Checks if given element can be deleted from this element. Following rules must be true to have result true: 1.this element must be editable. 2.project must be editable. 3.the type of given child must be valid for teamwork lock for edit operation (for example, class, package etc., not Attribute).
      Parameters:
      child - a given child
      Returns:
      true, if the given element can be deleted from the current element.
    • canBeDeleted

      @OpenApi boolean canBeDeleted()
      Checks if an element can be deleted from a project. Element cannot be deleted if it is not isEditable(), parent is not set, or parent does not allow to remove this element.
      Returns:
      true, if an element can be deleted from a project.
      See Also:
    • canAddInstance

      boolean canAddInstance(BaseElement o)
      Checks if this object can add element of given type. Current implementation returns false.
      Returns:
      true if this object can elements of a given type.
    • isSelfChangeable

      @OpenApi default boolean isSelfChangeable()
      Checks if properties of an element can be changes (like name, for example). Element can be isEditable(), but not @isSelfChangeable. It means that element can be deleted, for example, but element's owner or properties cannot be changed.
      Returns:
      true, if an element can be changed
      See Also:
    • isEditable

      @OpenApi boolean isEditable()
      Checks if an element can be edited.
      Returns:
      true, if an element can be edited.
    • canAddChild

      @OpenApi boolean canAddChild()
      Checks if new elements can be added to this element
      Returns:
      true, if new sub elements can be added.
    • getObjectParent

      @OpenApi @CheckForNull BaseElement getObjectParent()
      Returns the element parent. This implementation returns null. Should be overridden in subclasses.
      Returns:
      the parent of the element.
    • isParentOf

      boolean isParentOf(BaseElement obj)
      Returns true, if current element is parent of given element. Return false in this implementation.
      Parameters:
      obj - the given element(possible child).
      Returns:
      true if obj is the parent of this object.
    • canChangeParent

      boolean canChangeParent(Collection elements, BaseElement newParent)
      Returns true, if element can change parent.
      Parameters:
      elements - collection of the elements, whose will change the parent together with this.
      newParent - new parent object.
      Returns:
      true if an element can change parent.
    • clone

      Throws:
      CloneNotSupportedException