Package com.projity.grouping.core.model

Examples of com.projity.grouping.core.model.NodeModel


      return ((HasKey)impl).getId();
    return 0;
  }

  public boolean isParent() {
    NodeModel model= getResourcePool().getResourceOutline();
    return model.hasChildren(model.search(this));
  }
View Full Code Here


    public EventListener[] getListeners(Class listenerType) {
      return listenerList.getListeners(listenerType);
       }
 
    public boolean isReadOnly(){
      NodeModel nodeModel=cache.getModel();
      return !nodeModel.isLocal()&&!nodeModel.isMaster()&&!Environment.getStandAlone();
    }
View Full Code Here

        ,(object==null)?new LinkedList():((ResourceImpl)object).getAvailabilityTable().getList()
        ,(object==null)?null:((ResourceImpl)object).getAvailabilityTable(),
        1);
      if (object!=null){
        ResourceImpl resourceImpl=(ResourceImpl)object;
        NodeModel model=((SpreadSheetModel)availabilitySpreadsheet.getModel()).getCache().getModel();
//        availabilitySpreadsheet.clearActions();
        availabilitySpreadsheet.setReadOnly(resourceImpl.isReadOnly());
        availabilitySpreadsheet.setEnabled(!resourceImpl.isReadOnly());

        model.setMaster(resourceImpl.getGlobalResource().isMaster());
        model.setLocal(resourceImpl.getGlobalResource().isLocal());
        //TODO instead of doing this availabilityTable and Availability can contain a read-only field
      }
     
    }
View Full Code Here

          ,(object==null)?new LinkedList():((Resource)object).getCostRateTable(i).getList()
          ,(object==null)?null:((Resource)object).getCostRateTable(i)
          , 1);
          if (object!=null){
            ResourceImpl resourceImpl=(ResourceImpl)object;
            NodeModel model=((SpreadSheetModel)costTableSpreadsheets[i].getModel()).getCache().getModel();
//            costTableSpreadsheets[i].clearActions();
            costTableSpreadsheets[i].setReadOnly(resourceImpl.isReadOnly());
            costTableSpreadsheets[i].setEnabled(!resourceImpl.isReadOnly());
            model.setMaster(resourceImpl.getGlobalResource().isMaster());
            model.setLocal(resourceImpl.getGlobalResource().isLocal());
            //TODO instead of doing this availabilityTable and Availability can contain a read-only field
          }
       }
    }
View Full Code Here

  public NodeModel getDefaultOutline() {
    return getOutline(DEFAULT_OUTLINE);
  }

  public NodeModel getOutline(int outlineNumber) {
    NodeModel outline = outlines[outlineNumber];
    if (outline == null&&outlineNumber==DEFAULT_OUTLINE) { //TODO remove condition if multiple outlines are needed
      outline =  NodeModelFactory.getInstance().createNodeModel(dataFactory);
      outlines[outlineNumber] = outline;
      if (dataFactory!=null){
        dataFactory.initOutline(outline);
        outline.setUndoController(dataFactory.getUndoController());
      }
    }
    return outline;
  }
View Full Code Here

          addRowSelectionInterval(0, 0);
        }
    Node current = getCurrentRowNode();
    Node newNode = NodeFactory.getInstance().createNode(impl);
        SpreadSheetModel model=(SpreadSheetModel)getModel();
        NodeModel nodeModel = model.getCache().getModel();

    LinkedList previousNodes=model.getPreviousVisibleNodesFromRow(row);
    if (previousNodes==null) previousNodes=new LinkedList();
    previousNodes.add(current);
        nodeModel.addBefore(previousNodes,newNode,eventType);
        return newNode;
  }
View Full Code Here

    selectedResourcesOnTree.clear();
    selectedResourcesOnTree.addAll(resources);
    selectedResourcesOnTree.remove(ResourceImpl.getUnassignedInstance());
    int[] sel = new int[selectedResourcesOnTree.size()]; // if simple can only select 1
    Object resource;
    NodeModel nodeModel = chartInfo.getNodeModel();
   
    int topRow = Integer.MAX_VALUE;
    Object topResource = null;
    for (int i = 0; i < selectedResourcesOnTree.size(); i++) {
      resource = selectedResourcesOnTree.get(i);
      int row = nodeModel.getHierarchy().getIndexOfNode(nodeModel.search(resource),false);
      sel[i] = row;
      if (row < topRow) {
        topRow = row;
        topResource = resource;
      }
View Full Code Here

  }
 
  public void initializeOutlines(){
    int count=Settings.numHierarchies();
    for (int i=0;i<count;i++){
      NodeModel model=resourceOutlines.getOutline(i);
      if (model==null) continue;
      if (model instanceof AssignmentNodeModel){
        AssignmentNodeModel aModel=(AssignmentNodeModel)model;
        aModel.setDocument(this);
      }
View Full Code Here

  }
 
  private OutlineCollection resourceOutlines = new OutlineCollectionImpl(Settings.numHierarchies(),this);
 
  public NodeModel getResourceOutline() {
    NodeModel model=resourceOutlines.getOutline();
    return model;
  }
View Full Code Here

  public NodeModel getResourceOutline() {
    NodeModel model=resourceOutlines.getOutline();
    return model;
  }
  public NodeModel getResourceOutline(int outlineNumber) {
    NodeModel model=resourceOutlines.getOutline(outlineNumber);
    return model;
  }
View Full Code Here

TOP

Related Classes of com.projity.grouping.core.model.NodeModel

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.