1 /*******************************************************************************
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
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
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.g2d.layers;
15 * @author Antti Villberg
17 public interface IEditableLayer extends ILayer {
19 String PROP_NAME = "name";
24 public static class LayerChangeEvent {
25 private final ILayer source;
26 private final String property;
27 private final Object oldValue;
28 private final Object newValue;
29 public LayerChangeEvent(ILayer source, String property, Object oldValue, Object newValue) {
31 this.property = property;
32 this.oldValue = oldValue;
33 this.newValue = newValue;
35 public ILayer getSource() {
38 public String getProperty() {
41 public Object getOldValue() {
44 public Object getNewValue() {
51 * For listening to changes in a layer. For the time being the only thing
52 * that can change is the name.
54 public interface ILayerListener {
55 void layerChanged(LayerChangeEvent event);
58 void setName(String name);
60 void addLayerListener(ILayerListener l);
61 void removeLayerListener(ILayerListener l);