1 /*******************************************************************************
\r
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
\r
3 * in Industry THTH ry.
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.g2d.layers;
\r
15 * @author Antti Villberg
\r
17 public interface IEditableLayer extends ILayer {
\r
19 String PROP_NAME = "name";
\r
24 public static class LayerChangeEvent {
\r
25 private final ILayer source;
\r
26 private final String property;
\r
27 private final Object oldValue;
\r
28 private final Object newValue;
\r
29 public LayerChangeEvent(ILayer source, String property, Object oldValue, Object newValue) {
\r
30 this.source = source;
\r
31 this.property = property;
\r
32 this.oldValue = oldValue;
\r
33 this.newValue = newValue;
\r
35 public ILayer getSource() {
\r
38 public String getProperty() {
\r
41 public Object getOldValue() {
\r
44 public Object getNewValue() {
\r
51 * For listening to changes in a layer. For the time being the only thing
\r
52 * that can change is the name.
\r
54 public interface ILayerListener {
\r
55 void layerChanged(LayerChangeEvent event);
\r
58 void setName(String name);
\r
60 void addLayerListener(ILayerListener l);
\r
61 void removeLayerListener(ILayerListener l);
\r