1 7 package com.nightlabs.editor2d.impl; 8 9 import com.nightlabs.editor2d.Layer; 10 11 public class LayerImpl 12 extends DrawComponentContainerImpl 13 implements Layer 14 { 15 protected static final boolean VISIBLE_EDEFAULT = true; 16 protected boolean visible = VISIBLE_EDEFAULT; 17 18 protected static final boolean EDITABLE_EDEFAULT = true; 19 protected boolean editable = EDITABLE_EDEFAULT; 20 21 public LayerImpl() { 22 super(); 23 } 24 25 public boolean isVisible() { 26 return visible; 27 } 28 public void setVisible(boolean newVisible) { 29 boolean oldVisible = visible; 30 visible = newVisible; 31 firePropertyChange(PROP_VISIBLE, oldVisible, visible); 32 } 33 34 public boolean isEditable() { 35 return editable; 36 } 37 public void setEditable(boolean newEditable) { 38 boolean oldEditable = editable; 39 editable = newEditable; 40 firePropertyChange(PROP_EDITABLE, oldEditable, editable); 41 } 42 43 public String toString() 44 { 45 StringBuffer result = new StringBuffer (super.toString()); 46 result.append(" (visible: "); 47 result.append(visible); 48 result.append(", editable: "); 49 result.append(editable); 50 result.append(')'); 51 return result.toString(); 52 } 53 54 public String getTypeName() { 58 return "Layer"; 59 } 60 61 } | Popular Tags |