Changeset 7961
- Timestamp:
- 04/12/12 14:15:04 (8 years ago)
- Location:
- trunk/projects/slim-plugin/src/main/java/loci/slim/mask
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/projects/slim-plugin/src/main/java/loci/slim/mask/IMaskGroup.java
r7958 r7961 11 11 */ 12 12 public interface IMaskGroup { 13 14 public void addNode(MaskNode node); 13 15 16 public void removeNode(MaskNode node); 17 18 public void updateMask(IMaskNode node, Mask mask); 14 19 } -
trunk/projects/slim-plugin/src/main/java/loci/slim/mask/IMaskNode.java
r7958 r7961 11 11 */ 12 12 public interface IMaskNode { 13 14 /** 15 * This method notifies other nodes that this node has changed the mask. 16 * 17 * @param mask 18 */ 19 public void updateSelfMask(Mask mask); 13 20 14 public void applyMask(Mask mask); 21 /** 22 * Gets the current mask created by this node. 23 * 24 * @return 25 */ 26 public Mask getSelfMask(); 15 27 28 /** 29 * This method notifies a node that other nodes have changed the mask. 30 * 31 * @param mask 32 */ 33 public void updateOtherMask(Mask mask); 34 35 /** 36 * Gets the current mask created by all other nodes. 37 * 38 * @return 39 */ 40 public Mask getOtherMask(); 41 42 /** 43 * Gets the current mask. 44 * 45 * @return 46 */ 47 public Mask getTotalMask(); 16 48 } -
trunk/projects/slim-plugin/src/main/java/loci/slim/mask/Mask.java
r7959 r7961 17 17 public class Mask { 18 18 private boolean[][] _bits; 19 20 public Mask() {21 _bits = null;22 }23 19 24 20 public Mask(boolean[][] bits) { -
trunk/projects/slim-plugin/src/main/java/loci/slim/mask/MaskGroup.java
r7959 r7961 13 13 /** 14 14 * 15 * @author aivar15 * @author Aivar Grislis 16 16 */ 17 public class MaskGroup {17 public class MaskGroup implements IMaskGroup { 18 18 List<IMaskNode> _nodeList; 19 19 Map<IMaskNode, Mask> _maskMap; … … 25 25 } 26 26 27 27 @Override 28 28 public void addNode(MaskNode node) { 29 29 _nodeList.add(node); 30 30 } 31 31 32 @Override 32 33 public void removeNode(MaskNode node) { 33 34 _nodeList.remove(node); … … 35 36 } 36 37 38 @Override 37 39 public void updateMask(IMaskNode node, Mask mask) { 38 40 // update map with given mask … … 45 47 // don't combine the recipients mask 46 48 Mask combinedMask = Mask.addOtherMasks(mask, _maskMap.values()); 47 otherNode. applyMask(combinedMask);49 otherNode.updateOtherMask(combinedMask); 48 50 } 49 51 } -
trunk/projects/slim-plugin/src/main/java/loci/slim/mask/MaskNode.java
r7958 r7961 12 12 public class MaskNode implements IMaskNode { 13 13 IMaskGroup _maskGroup; 14 Mask _selfMask; 15 Mask _otherMask; 16 17 public MaskNode(IMaskGroup maskGroup) { 18 _maskGroup = maskGroup; 19 } 14 20 15 public void applyMask(Mask mask) { 16 17 } 21 /** 22 * This method notifies other nodes that this node has changed the mask. 23 * 24 * @param mask 25 */ 26 public void updateSelfMask(Mask mask) { 27 _maskGroup.updateMask(this, mask); 28 //TODO ARG promulgate changes 29 // this should change the image and not the histogram 30 } 31 32 /** 33 * Gets the current mask created by this node. 34 * 35 * @return 36 */ 37 public Mask getSelfMask() { 38 return _selfMask; 39 } 40 41 /** 42 * This method notifies a node that other nodes have changed the mask. 43 * 44 * @param mask 45 */ 46 public void updateOtherMask(Mask mask) { 47 _otherMask = mask; 48 //TODO ARG promulgate changes; need a listener 49 // this should change the image and the histogram 50 } 51 52 /** 53 * Gets the current mask created by all other nodes. 54 * 55 * @return 56 */ 57 public Mask getOtherMask() { 58 return _otherMask; 59 } 60 61 /** 62 * Gets the current mask. 63 * 64 * @return 65 */ 66 public Mask getTotalMask() { 67 return _selfMask.add(_otherMask); 68 } 18 69 }
Note: See TracChangeset
for help on using the changeset viewer.