]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.g2d/src/org/simantics/g2d/element/handler/impl/DefaultParameters.java
Editing of texts inside SVG elements
[simantics/platform.git] / bundles / org.simantics.g2d / src / org / simantics / g2d / element / handler / impl / DefaultParameters.java
1 /*******************************************************************************
2  * Copyright (c) 2017 Association for Decentralized Information Management
3  * in Industry THTH ry.
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  *     Semantum Oy - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.g2d.element.handler.impl;
13
14 import java.util.Map;
15
16 import org.simantics.g2d.element.ElementHints;
17 import org.simantics.g2d.element.IElement;
18 import org.simantics.g2d.element.handler.Parameters;
19
20 /**
21  * @author Antti Villberg
22  * @since 1.31.0
23  */
24 public class DefaultParameters implements Parameters {
25
26         private static final long serialVersionUID = -9138310692519364097L;
27
28         public static final DefaultParameters INSTANCE = new DefaultParameters();
29
30         @Override
31         public Map<String, Object> getParameters(IElement e) {
32                 return e.getHint(ElementHints.KEY_PARAMETERS);
33         }
34
35         @Override
36         public void setParameters(IElement e, Map<String, Object> p) {
37                 if (p != null) {
38                         e.setHint(ElementHints.KEY_PARAMETERS, p);
39                 } else {
40                         e.removeHint(ElementHints.KEY_PARAMETERS);
41                 }
42         }
43
44 }