|
| 1 | +package com.defaultMutableTreeNode; |
| 2 | + |
| 3 | +import javax.swing.tree.MutableTreeNode; |
| 4 | +import javax.swing.tree.TreeNode; |
| 5 | + |
| 6 | +import liquidjava.specification.ExternalRefinementsFor; |
| 7 | +import liquidjava.specification.Refinement; |
| 8 | +import liquidjava.specification.RefinementAlias; |
| 9 | +import liquidjava.specification.StateRefinement; |
| 10 | +import liquidjava.specification.StateSet; |
| 11 | + |
| 12 | +@RefinementAlias("Positive(int i) { i >= 0 }") |
| 13 | +@ExternalRefinementsFor("javax.swing.tree.DefaultMutableTreeNode") |
| 14 | +@StateSet({"childrenAllowed", "childrenNotAllowed"}) |
| 15 | +public interface DefaultMutableTreeNodeRefinements { |
| 16 | + |
| 17 | + @StateRefinement(to="childrenAllowed(this)") |
| 18 | + public void DefaultMutableTreeNode(); |
| 19 | + |
| 20 | + @StateRefinement(to="childrenAllowed(this)") |
| 21 | + public void DefaultMutableTreeNode(Object userObject); |
| 22 | + |
| 23 | + @StateRefinement(to="allowsChildren ? childrenAllowed(this) : childrenNotAllowed(this)") |
| 24 | + public void DefaultMutableTreeNode(Object userObject, boolean allowsChildren); |
| 25 | + |
| 26 | + @StateRefinement(from="childrenAllowed(this)") |
| 27 | + public void insert(MutableTreeNode newChild, @Refinement("Positive(_)") int childIndex); |
| 28 | + |
| 29 | + @StateRefinement(from="childrenAllowed(this)") |
| 30 | + public void add(MutableTreeNode newChild); |
| 31 | + |
| 32 | + @StateRefinement(to="allows ? childrenAllowed(this) : childrenNotAllowed(this)") |
| 33 | + public void setAllowsChildren(boolean allows); |
| 34 | + |
| 35 | + @Refinement("childrenAllowed(this) ? true : false") |
| 36 | + public boolean getAllowsChildren(); |
| 37 | + |
| 38 | + public void remove(@Refinement("Positive(_)") int childIndex); |
| 39 | + |
| 40 | + public TreeNode getChildAt(@Refinement("Positive(_)") int index); |
| 41 | + |
| 42 | + @Refinement("Positive(_)") |
| 43 | + public int getChildCount(); |
| 44 | + |
| 45 | + @Refinement("Positive(_) || _ == -1") |
| 46 | + public int getIndex(TreeNode aChild); |
| 47 | +} |
0 commit comments