1// BEGIN LICENSE BLOCK 2// Version: CMPL 1.1 3// 4// The contents of this file are subject to the Cisco-style Mozilla Public 5// License Version 1.1 (the "License"); you may not use this file except 6// in compliance with the License. You may obtain a copy of the License 7// at www.eclipse-clp.org/license. 8// 9// Software distributed under the License is distributed on an "AS IS" 10// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 11// the License for the specific language governing rights and limitations 12// under the License. 13// 14// The Original Code is CPViz Constraint Visualization System 15// The Initial Developer of the Original Code is Helmut Simonis 16// Portions created by the Initial Developer are 17// Copyright (C) 2009-2010 Helmut Simonis 18// 19// Contributor(s): Helmut Simonis, 4C, Univerity College Cork, Cork 20// 21// 22// END LICENSE BLOCK 23// ---------------------------------------------------------------------- 24package ie.ucc.cccc.viz; 25import java.util.*; 26 27/** 28 * Holds the collections of Tools for the tree and viz visualizers 29 * @author hsimonis 30 * 31 */ 32public class Tools { 33 private String directory; 34 private String idx; 35 private List<Tool> treeTools; 36 private List<Tool> vizTools; 37 38 public Tools() { 39 treeTools = new ArrayList<Tool>(); 40 vizTools = new ArrayList<Tool>(); 41 } 42 43 void setDirectory(String directory){ 44 this.directory = directory; 45 } 46 void setIdx(String idx){ 47 this.idx = idx; 48 } 49 public String getDirectory() { 50 return directory; 51 } 52 public String getIdx(){ 53 return idx; 54 } 55 56 public List<Tool> getTreeTools() { 57 return treeTools; 58 } 59 public boolean hasTreeTools() { 60 return treeTools.size() > 0; 61 } 62 63 public List<Tool> getVizTools() { 64 return vizTools; 65 } 66 public boolean hasVizTools() { 67 return vizTools.size() > 0; 68 } 69 70 71 /** 72 * When adding a Tool, place it in the correct list 73 * @param tool 74 */ 75 public void addTool(Tool tool){ 76 if (tool.getShow().equals("tree")) { 77 treeTools.add(tool); 78 } else if (tool.getShow().equals("viz")) { 79 vizTools.add(tool); 80 } else{ 81 System.out.println("Tool has wrong show value "+tool); 82 } 83 } 84 85} 86