added layer locking

added eyelet board
This commit is contained in:
bancika
2011-01-22 13:17:43 +00:00
parent 99d85a2d1f
commit 664bf91852
15 changed files with 372 additions and 67 deletions
@@ -75,5 +75,7 @@ public enum EventType {
* Called when mouse cursor is moved. Point object is passed, containing the
* current cursor location (not taking zoom into account).
*/
MOUSE_MOVED;
MOUSE_MOVED,
LAYER_STATE_CHANGED;
;
}
@@ -34,6 +34,8 @@ import com.diyfever.gui.update.VersionNumber;
* @see EventType
*/
public interface IPlugInPort {
public static final String CHECK_BOX_MENU_ITEM = "org.diylc.checkBoxMenuItem";
/**
* Returns size of the canvas that takes project dimensions into account as
@@ -349,4 +351,6 @@ public interface IPlugInPort {
* Ungroups all selected components.
*/
void ungroupSelectedComponents();
void setLayerLocked(int layerZOrder, boolean locked);
}
@@ -1,26 +1,33 @@
package org.diylc.common;
import java.awt.AlphaComposite;
import java.awt.BasicStroke;
import java.awt.Stroke;
import java.util.HashMap;
import java.util.Map;
/**
* Repository for object that may be reused, such as {@link Stroke} or
* {@link AlphaComposite}.
*
* @author Branislav Stojkovic
*/
public class ObjectCache {
private static ObjectCache instance;
public static ObjectCache getInstance() {
if (instance == null) {
instance = new ObjectCache();
}
return instance;
}
private ObjectCache() {
}
private Map<Integer, Stroke> basicStrokeMap = new HashMap<Integer, Stroke>();
public Stroke fetchBasicStroke(int width) {
if (basicStrokeMap.containsKey(width)) {
return basicStrokeMap.get(width);