1 26 27 package org.nightlabs.editor2d.impl; 28 29 import org.nightlabs.editor2d.DrawComponent; 30 import org.nightlabs.editor2d.DrawComponentContainer; 31 import org.nightlabs.editor2d.Layer; 32 33 public class LayerImpl 34 extends DrawComponentContainerImpl 35 implements Layer 36 { 37 protected static final boolean VISIBLE_EDEFAULT = true; 38 protected boolean visible = VISIBLE_EDEFAULT; 39 40 protected static final boolean EDITABLE_EDEFAULT = true; 41 protected boolean editable = EDITABLE_EDEFAULT; 42 43 public LayerImpl() { 44 super(); 45 } 46 47 public boolean isVisible() { 48 return visible; 49 } 50 public void setVisible(boolean newVisible) { 51 boolean oldVisible = visible; 52 visible = newVisible; 53 firePropertyChange(PROP_VISIBLE, oldVisible, visible); 54 } 55 56 public boolean isEditable() { 57 return editable; 58 } 59 public void setEditable(boolean newEditable) { 60 boolean oldEditable = editable; 61 editable = newEditable; 62 firePropertyChange(PROP_EDITABLE, oldEditable, editable); 63 } 64 65 public String toString() 66 { 67 StringBuffer result = new StringBuffer (super.toString()); 68 result.append(" (visible: "); 69 result.append(visible); 70 result.append(", editable: "); 71 result.append(editable); 72 result.append(')'); 73 return result.toString(); 74 } 75 76 public String getTypeName() { 80 return "Layer"; 81 } 82 83 public void notifyChildTransform(DrawComponent child) 85 { 86 87 } 88 89 public Object clone(DrawComponentContainer parent) 90 { 91 LayerImpl layer = (LayerImpl) super.clone(parent); 92 return layer; 93 } 94 95 104 } | Popular Tags |