Package gov.nasa.arc.mct.components

Examples of gov.nasa.arc.mct.components.AbstractComponent


       
        dropboxParents.add(dropboxContainer);
    }
   
    private AbstractComponent createComponent(Class<? extends AbstractComponent> clazz) {
        AbstractComponent newInstance = null;
        try {
            newInstance = clazz.newInstance();
            newInstance.getCapability(ComponentInitializer.class).initialize();
        } catch (InstantiationException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }
View Full Code Here


  /* (non-Javadoc)
   * @see gov.nasa.arc.mct.policy.Policy#execute(gov.nasa.arc.mct.policy.PolicyContext)
   */
  @Override
  public ExecutionResult execute(PolicyContext context) {
    AbstractComponent multi = context.getProperty(PolicyContext.PropertyName.TARGET_COMPONENT.getName(), AbstractComponent.class);
    @SuppressWarnings("unchecked")
    Collection<AbstractComponent> sources = context.getProperty(PolicyContext.PropertyName.SOURCE_COMPONENTS.getName(), Collection.class);
    boolean canExecute = true;
    if (multi.getCapability(MultiComponent.class) != null) {
      for (AbstractComponent ac : sources) {
        if (ac.getExternalKey() != null) {
          if (((MultiComponent) multi).getData().getCode().contains(ac.getExternalKey())) {
            canExecute = false;
          }
View Full Code Here

  public ExecutionResult execute(PolicyContext context) {
    boolean result = true;
   
    ViewInfo viewInfo = context.getProperty(PolicyContext.PropertyName.TARGET_VIEW_INFO.getName(), ViewInfo.class);
    if (viewInfo.getViewClass().equals(ExpressionsViewManifestation.class)) {
      AbstractComponent targetComponent = context.getProperty(PolicyContext.PropertyName.TARGET_COMPONENT.getName(), AbstractComponent.class);
     
      result = isEnumerator(targetComponent);
    }
   
    String message = null;
View Full Code Here

  /* (non-Javadoc)
   * @see gov.nasa.arc.mct.policy.Policy#execute(gov.nasa.arc.mct.policy.PolicyContext)
   */
  @Override
  public ExecutionResult execute(PolicyContext context) {
    AbstractComponent multi = context.getProperty(PolicyContext.PropertyName.TARGET_COMPONENT.getName(), AbstractComponent.class);
    @SuppressWarnings("unchecked")
    Collection<AbstractComponent> sources = context.getProperty(PolicyContext.PropertyName.SOURCE_COMPONENTS.getName(), Collection.class);
    if (multi.getCapability(MultiComponent.class) != null) {
      if (sources != null) {
        for (AbstractComponent ac : sources) {
          if (ac.getCapability(FeedProvider.class) == null) {
//            OptionBox.showMessageDialog(
//                            null,
View Full Code Here

        this.draggedViews = draggedViews;
        this.dropView = dropView;
        this.index = Math.min(index, dropView.getManifestedComponent().getComponents().size());
       
        for (View v : draggedViews) {
            AbstractComponent child = v.getManifestedComponent();
            if (child != null) {
                droppedComponents.add(child);
            }
        }    
        Collections.reverse(droppedComponents);
View Full Code Here

        for (TreePath path : selectedTreePaths) {
           
            MCTMutableTreeNode selectedNode = (MCTMutableTreeNode) path.getLastPathComponent();
            MCTMutableTreeNode parentNode = (MCTMutableTreeNode) selectedNode.getParent();
       
            AbstractComponent parentComponent = ((View) parentNode.getUserObject()).getManifestedComponent();
            AbstractComponent selectedComponent = ((View) selectedNode.getUserObject()).getManifestedComponent();
       
            if (selectedComponent == null) {
                OptionBox.showMessageDialog(null, "Unable to create duplicate of this object!", "Error creating duplicate.", OptionBox.ERROR_MESSAGE);
                return;
            }
           
            DuplicateObjectDialog dialog = new DuplicateObjectDialog(actionContext.getTargetHousing().getHostedFrame(),
                                                            selectedComponent.getDisplayName());
            String name = dialog.getConfirmedTelemetryGroupName();

            if (!StringUtil.isEmpty(name)) {
                AbstractComponent duplicate = selectedComponent.clone();
                ComponentInitializer ci = duplicate.getCapability(ComponentInitializer.class);
                ci.setCreator(GlobalContext.getGlobalContext().getUser().getUserId());
                ci.setOwner(GlobalContext.getGlobalContext().getUser().getUserId());
                duplicate.setDisplayName(name);
                duplicate.save();
                parentComponent.addDelegateComponent(duplicate);
                parentComponent.save();
            }

        }
View Full Code Here

            return false;
       
       
        MCTMutableTreeNode selectedNode = (MCTMutableTreeNode) selectedTreePaths[0].getLastPathComponent();
        MCTMutableTreeNode parentNode = (MCTMutableTreeNode) selectedNode.getParent();
        AbstractComponent parentComponent = ((View) parentNode.getUserObject()).getManifestedComponent();

        return isParentComponentModifiable(parentComponent);
    }
View Full Code Here

        return PolicyManagerImpl.getInstance().execute(compositionKey, policyContext).getStatus();
    }
   
    @Override
    public boolean isEnabled() {
        AbstractComponent component = actionContext.getTargetComponent();
        if (component == null || component.getExternalKey() != null)
            return false;
       
        return true;
    }
View Full Code Here

    private static ResourceBundle bundle = ResourceBundle.getBundle("CanvasResourceBundle");
   
    @Override
    public ExecutionResult execute(PolicyContext context) {
        AbstractComponent component = context.getProperty(PolicyContext.PropertyName.TARGET_COMPONENT.getName(), AbstractComponent.class);
        return new ExecutionResult(context, component.getWorkUnitDelegate()==null, bundle.getString("CanvasOwnedViewsPolicyMessage"));
    }
View Full Code Here

       
        public DragDropMove() {
            for (View v : draggedViews) {
                View parent = v.getParentView();
                if (parent != null) {
                    AbstractComponent parentComponent = parent.getManifestedComponent();
                    String id = parentComponent.getId();
                    if (!id.equals(dropView.getManifestedComponent().getComponentId())) {
                        parents.put(id, parentComponent);
                        if (!toRemove.containsKey(id)) {
                            toRemove.put(id, new ArrayList<AbstractComponent>());
                        }
View Full Code Here

TOP

Related Classes of gov.nasa.arc.mct.components.AbstractComponent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.