Lines 710-713
Link Here
|
710 |
*/ |
710 |
*/ |
711 |
public Set<Workspace> whereOpened(); |
711 |
public Set<Workspace> whereOpened(); |
712 |
} |
712 |
} |
|
|
713 |
////////////////////////////////////////////////////////////////////// |
714 |
// |
715 |
// REVIEWERS: |
716 |
// - For side, could have enum WindowManager.Side |
717 |
// (then have Orientation in WindowManager instead of SiblingState |
718 |
// |
719 |
// - The WeightCalculator is removed from these addMode* API |
720 |
// to simplify implementation. |
721 |
// It can be put back and handled here, |
722 |
// then performance optimized at a later date. |
723 |
// |
724 |
// - The original proposal returned the new mode, but that isn't |
725 |
// a pattern I see around. Should it return a mode? |
726 |
// |
727 |
////////////////////////////////////////////////////////////////////// |
728 |
|
729 |
/** |
730 |
* Add a new Mode, with a TopComponent in it, on a side of the specified |
731 |
* mode. Constants from JSplitPane are used to specify the side: |
732 |
* TOP, BOTTOM, LEFT, RIGHT. |
733 |
* |
734 |
* @param mode the new mode is next to this mode |
735 |
* @param side which side to attach the new mode. |
736 |
* @param tc TopComponent to put into the new mode. |
737 |
*/ |
738 |
abstract public void addModeOnSide(Mode mode, String side, TopComponent tc); |
739 |
|
740 |
/** |
741 |
* Add a new Mode, with a TopComponent in it, that touches the side |
742 |
* of the specified mode. The new mode is either wider or higher |
743 |
* than the mode. |
744 |
* Constants from JSplitPane are used to specify the side: |
745 |
* TOP, BOTTOM, LEFT, RIGHT. |
746 |
* When mode's container's orientation is the same as |
747 |
* the specified side, this method does the same thing as addModeOnSide. |
748 |
* |
749 |
* @param mode |
750 |
* @param side |
751 |
* @param tc |
752 |
*/ |
753 |
abstract public void addModeAround(Mode mode, String side, TopComponent tc); |
754 |
|
755 |
////////////////////////////////////////////////////////////////////// |
756 |
// |
757 |
// REVIEWERS: |
758 |
// The restriction that the specified mode's weight must |
759 |
// be changed can be relaxed so that a modification to any |
760 |
// weight will trigger a change. |
761 |
// |
762 |
// To do that is trivial if in |
763 |
// ViewRequest(null, View.CHANGE_MODE_CONSTRAINTS_CHANGED, |
764 |
// oldConstraints, newConstraints) |
765 |
// it doesn't matter if oldContstraints == newConstraints. Or |
766 |
// if oldConstraints can simply be set to null. |
767 |
// If the type of ViewRequest requires accurate old/new then |
768 |
// the restriction can still be relaxed by keeping track |
769 |
// of the constraints for each of the modes. |
770 |
// |
771 |
////////////////////////////////////////////////////////////////////// |
772 |
|
773 |
/** |
774 |
* Change the sizing weights of a mode, and optionally its siblings, |
775 |
* within a splitter. If the weight for the specified mode is not |
776 |
* changed then no action takes place even if sibling weights are |
777 |
* changed. |
778 |
* @param mode |
779 |
* @param wc provides new size informaiton |
780 |
* @return true if the sizes changed |
781 |
*/ |
782 |
abstract public boolean adjustSizes(Mode mode, WeightCalculator wc); |
783 |
|
784 |
/** |
785 |
* Used with the adjustSizes method to provide new weights. |
786 |
*/ |
787 |
public interface WeightCalculator { |
788 |
/** |
789 |
* Invoked by the window system to get the new weights. |
790 |
* @param currentState splitter and sibling information |
791 |
* @return new weights |
792 |
*/ |
793 |
List<Double> getWeights(SiblingState currentState); |
794 |
} |
795 |
|
796 |
/** |
797 |
* Information about a splitter's children. |
798 |
*/ |
799 |
public interface SiblingState { |
800 |
enum Orientation { HORIZONTAL, VERTICAL; } |
801 |
/** |
802 |
* Splitter orientation. |
803 |
* @return the splitter orientation |
804 |
*/ |
805 |
Orientation getOrientation(); |
806 |
/** |
807 |
* @return the index of the mode to change |
808 |
*/ |
809 |
int getTargetIndex(); |
810 |
/** |
811 |
* The current weights of the splitter's children, either top to bottom |
812 |
* or left to right depending on orientation. The returned list |
813 |
* can be modified. |
814 |
* @return current weights |
815 |
*/ |
816 |
List<Double> getWeights(); |
817 |
} |
713 |
} |
818 |
} |