| /******************************************************************************* |
| * Copyright (c) 2010 Zoltan Ujhelyi and Istvan Rath and Daniel Varro. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * Istvan Rath - initial API and implementation |
| *******************************************************************************/ |
| package org.eclipse.viatra2.visualisation.common.extensions; |
| |
| import java.util.HashMap; |
| import java.util.Map; |
| |
| import org.eclipse.jface.viewers.ViewerFilter; |
| import org.eclipse.viatra2.visualisation.ViatraColoredLabelProvider; |
| import org.eclipse.viatra2.visualisation.layouts.IViatraLayoutAlgorithm; |
| |
| /** |
| * DTO for Categories. |
| * refers to: |
| * - filters |
| * - filterconfigurations |
| * - layouts |
| * - labelproviders |
| * - presets |
| * @author istvan |
| * |
| */ |
| public class Category { |
| /** |
| * The string identifier of the category |
| */ |
| public String id; |
| /** |
| * The name of the category (visible in the user interface) |
| */ |
| public String name; |
| /** |
| * A weight used to provide a consistent ordering of the categories |
| */ |
| public String orderID="0"; |
| /** |
| * All filters defined in the category |
| */ |
| public Map<String,NamedElement<ViewerFilter>> filters; |
| /** |
| * All label providers defined in the category |
| */ |
| public Map<String,NamedElement<ViatraColoredLabelProvider>> labelproviders; |
| /** |
| * All layout algorithms defined in the category |
| */ |
| public Map<String,NamedElement<IViatraLayoutAlgorithm>> layouts; |
| /** |
| * All filter configurations defined in the category |
| */ |
| public Map<String,NamedElement<FilterConfiguration>> filterConfigurations; |
| /** |
| * All presets stored in the category |
| */ |
| public Map<String,NamedElement<VisualisationPreset>> presets; |
| /** |
| * Initializes a category with the selected id, name and orderID |
| * @param _id |
| * @param _name |
| * @param _orderID |
| */ |
| public Category(String _id, String _name, String _orderID){ |
| this.id=_id; this.name=_name; if (_orderID!=null) { this.orderID=_orderID; }; |
| filters = new HashMap<String,NamedElement<ViewerFilter>>(); |
| labelproviders = new HashMap<String, NamedElement<ViatraColoredLabelProvider>>(); |
| layouts = new HashMap<String, NamedElement<IViatraLayoutAlgorithm>>(); |
| filterConfigurations = new HashMap<String, NamedElement<FilterConfiguration>>(); |
| presets = new HashMap<String, NamedElement<VisualisationPreset>>(); |
| } |
| |
| } |