Examples of RibbonBandResizeSequencingPolicy


Examples of org.pushingpixels.flamingo.api.ribbon.resize.RibbonBandResizeSequencingPolicy

      }

      int availableBandHeight = c.getHeight();
      int availableWidth = c.getWidth();
      if (selectedTask.getBandCount() > 0) {
        RibbonBandResizeSequencingPolicy resizeSequencingPolicy = selectedTask
            .getResizeSequencingPolicy();
        resizeSequencingPolicy.reset();
        AbstractRibbonBand<?> currToTakeFrom = resizeSequencingPolicy
            .next();
        while (true) {
          // check whether all bands have the current resize
          // policy as their last (most restrictive) registered policy
          boolean noMore = true;
          for (AbstractRibbonBand<?> band : selectedTask.getBands()) {
            RibbonBandResizePolicy currentResizePolicy = band
                .getCurrentResizePolicy();
            List<RibbonBandResizePolicy> resizePolicies = band
                .getResizePolicies();
            if (currentResizePolicy != resizePolicies
                .get(resizePolicies.size() - 1)) {
              noMore = false;
              break;
            }
          }
          if (noMore)
            break;

          // get the current preferred width of the bands
          int totalWidth = 0;
          // System.out.println("Iteration");
          for (AbstractRibbonBand<?> ribbonBand : selectedTask
              .getBands()) {
            RibbonBandResizePolicy currentResizePolicy = ribbonBand
                .getCurrentResizePolicy();

            Insets ribbonBandInsets = ribbonBand.getInsets();
            AbstractBandControlPanel controlPanel = ribbonBand
                .getControlPanel();
            if (controlPanel == null) {
              controlPanel = ribbonBand.getPopupRibbonBand()
                  .getControlPanel();
            }
            Insets controlPanelInsets = controlPanel.getInsets();
            int controlPanelGap = controlPanel.getUI()
                .getLayoutGap();
            int ribbonBandHeight = availableBandHeight
                - ribbonBandInsets.top
                - ribbonBandInsets.bottom;
            int availableHeight = ribbonBandHeight
                - ribbonBand.getUI().getBandTitleHeight();
            if (controlPanel != null) {
              availableHeight = availableHeight
                  - controlPanelInsets.top
                  - controlPanelInsets.bottom;
            }
            int preferredWidth = currentResizePolicy
                .getPreferredWidth(availableHeight,
                    controlPanelGap)
                + ribbonBandInsets.left
                + ribbonBandInsets.right;
            totalWidth += preferredWidth + bandGap;
            // System.out.println("\t"
            // + ribbonBand.getTitle()
            // + ":"
            // + currentResizePolicy.getClass()
            // .getSimpleName() + ":" + preferredWidth
            // + " under " + availableHeight + " with "
            // + controlPanel.getComponentCount()
            // + " children");
          }
          // System.out.println("\t:Total:" + totalWidth + "("
          // + availableWidth + ")");
          // System.out.println("\n");
          if (totalWidth < availableWidth)
            break;

          // try to take from the currently rotating band
          List<RibbonBandResizePolicy> policies = currToTakeFrom
              .getResizePolicies();
          int currPolicyIndex = policies.indexOf(currToTakeFrom
              .getCurrentResizePolicy());
          if (currPolicyIndex == (policies.size() - 1)) {
            // nothing to take
          } else {
            currToTakeFrom.setCurrentResizePolicy(policies
                .get(currPolicyIndex + 1));
          }
          currToTakeFrom = resizeSequencingPolicy.next();
        }
      }

      boolean ltr = c.getComponentOrientation().isLeftToRight();
      x = ltr ? 1 : c.getWidth() - 1;
View Full Code Here

Examples of org.pushingpixels.flamingo.api.ribbon.resize.RibbonBandResizeSequencingPolicy

      }

      int availableBandHeight = c.getHeight();
      int availableWidth = c.getWidth();
      if (selectedTask.getBandCount() > 0) {
        RibbonBandResizeSequencingPolicy resizeSequencingPolicy = selectedTask
            .getResizeSequencingPolicy();
        resizeSequencingPolicy.reset();
        AbstractRibbonBand<?> currToTakeFrom = resizeSequencingPolicy
            .next();
        while (true) {
          // check whether all bands have the current resize
          // policy as their last (most restrictive) registered policy
          boolean noMore = true;
          for (AbstractRibbonBand<?> band : selectedTask.getBands()) {
            RibbonBandResizePolicy currentResizePolicy = band
                .getCurrentResizePolicy();
            List<RibbonBandResizePolicy> resizePolicies = band
                .getResizePolicies();
            if (currentResizePolicy != resizePolicies
                .get(resizePolicies.size() - 1)) {
              noMore = false;
              break;
            }
          }
          if (noMore)
            break;

          // get the current preferred width of the bands
          int totalWidth = 0;
          // System.out.println("Iteration");
          for (AbstractRibbonBand<?> ribbonBand : selectedTask
              .getBands()) {
            RibbonBandResizePolicy currentResizePolicy = ribbonBand
                .getCurrentResizePolicy();

            Insets ribbonBandInsets = ribbonBand.getInsets();
            AbstractBandControlPanel controlPanel = ribbonBand
                .getControlPanel();
            if (controlPanel == null) {
              controlPanel = ribbonBand.getPopupRibbonBand()
                  .getControlPanel();
            }
            Insets controlPanelInsets = controlPanel.getInsets();
            int controlPanelGap = controlPanel.getUI()
                .getLayoutGap();
            int ribbonBandHeight = availableBandHeight
                - ribbonBandInsets.top
                - ribbonBandInsets.bottom;
            int availableHeight = ribbonBandHeight
                - ribbonBand.getUI().getBandTitleHeight();
            if (controlPanel != null) {
              availableHeight = availableHeight
                  - controlPanelInsets.top
                  - controlPanelInsets.bottom;
            }
            int preferredWidth = currentResizePolicy
                .getPreferredWidth(availableHeight,
                    controlPanelGap)
                + ribbonBandInsets.left
                + ribbonBandInsets.right;
            totalWidth += preferredWidth + bandGap;
            // System.out.println("\t"
            // + ribbonBand.getTitle()
            // + ":"
            // + currentResizePolicy.getClass()
            // .getSimpleName() + ":" + preferredWidth
            // + " under " + availableHeight + " with "
            // + controlPanel.getComponentCount()
            // + " children");
          }
          // System.out.println("\t:Total:" + totalWidth + "("
          // + availableWidth + ")");
          // System.out.println("\n");
          if (totalWidth < availableWidth)
            break;

          // try to take from the currently rotating band
          List<RibbonBandResizePolicy> policies = currToTakeFrom
              .getResizePolicies();
          int currPolicyIndex = policies.indexOf(currToTakeFrom
              .getCurrentResizePolicy());
          if (currPolicyIndex == (policies.size() - 1)) {
            // nothing to take
          } else {
            currToTakeFrom.setCurrentResizePolicy(policies
                .get(currPolicyIndex + 1));
          }
          currToTakeFrom = resizeSequencingPolicy.next();
        }
      }

      boolean ltr = c.getComponentOrientation().isLeftToRight();
      x = ltr ? 1 : c.getWidth() - 1;
View Full Code Here

Examples of org.pushingpixels.flamingo.api.ribbon.resize.RibbonBandResizeSequencingPolicy

      }

      int availableBandHeight = c.getHeight();
      int availableWidth = c.getWidth();
      if (selectedTask.getBandCount() > 0) {
        RibbonBandResizeSequencingPolicy resizeSequencingPolicy = selectedTask
            .getResizeSequencingPolicy();
        resizeSequencingPolicy.reset();
        AbstractRibbonBand<?> currToTakeFrom = resizeSequencingPolicy
            .next();
        while (true) {
          // check whether all bands have the current resize
          // policy as their last (most restrictive) registered policy
          boolean noMore = true;
          for (AbstractRibbonBand<?> band : selectedTask.getBands()) {
            RibbonBandResizePolicy currentResizePolicy = band
                .getCurrentResizePolicy();
            List<RibbonBandResizePolicy> resizePolicies = band
                .getResizePolicies();
            if (currentResizePolicy != resizePolicies
                .get(resizePolicies.size() - 1)) {
              noMore = false;
              break;
            }
          }
          if (noMore)
            break;

          // get the current preferred width of the bands
          int totalWidth = 0;
          // System.out.println("Iteration");
          for (AbstractRibbonBand<?> ribbonBand : selectedTask
              .getBands()) {
            RibbonBandResizePolicy currentResizePolicy = ribbonBand
                .getCurrentResizePolicy();

            Insets ribbonBandInsets = ribbonBand.getInsets();
            AbstractBandControlPanel controlPanel = ribbonBand
                .getControlPanel();
            if (controlPanel == null) {
              controlPanel = ribbonBand.getPopupRibbonBand()
                  .getControlPanel();
            }
            Insets controlPanelInsets = controlPanel.getInsets();
            int controlPanelGap = controlPanel.getUI()
                .getLayoutGap();
            int ribbonBandHeight = availableBandHeight
                - ribbonBandInsets.top
                - ribbonBandInsets.bottom;
            int availableHeight = ribbonBandHeight
                - ribbonBand.getUI().getBandTitleHeight();
            if (controlPanel != null) {
              availableHeight = availableHeight
                  - controlPanelInsets.top
                  - controlPanelInsets.bottom;
            }
            int preferredWidth = currentResizePolicy
                .getPreferredWidth(availableHeight,
                    controlPanelGap)
                + ribbonBandInsets.left
                + ribbonBandInsets.right;
            totalWidth += preferredWidth + bandGap;
            // System.out.println("\t"
            // + ribbonBand.getTitle()
            // + ":"
            // + currentResizePolicy.getClass()
            // .getSimpleName() + ":" + preferredWidth
            // + " under " + availableHeight + " with "
            // + controlPanel.getComponentCount()
            // + " children");
          }
          // System.out.println("\t:Total:" + totalWidth + "("
          // + availableWidth + ")");
          // System.out.println("\n");
          if (totalWidth < availableWidth)
            break;

          // try to take from the currently rotating band
          List<RibbonBandResizePolicy> policies = currToTakeFrom
              .getResizePolicies();
          int currPolicyIndex = policies.indexOf(currToTakeFrom
              .getCurrentResizePolicy());
          if (currPolicyIndex == (policies.size() - 1)) {
            // nothing to take
          } else {
            currToTakeFrom.setCurrentResizePolicy(policies
                .get(currPolicyIndex + 1));
          }
          currToTakeFrom = resizeSequencingPolicy.next();
        }
      }

      boolean ltr = c.getComponentOrientation().isLeftToRight();
      x = ltr ? 1 : c.getWidth() - 1;
View Full Code Here

Examples of org.pushingpixels.flamingo.api.ribbon.resize.RibbonBandResizeSequencingPolicy

      }

      int availableBandHeight = c.getHeight();
      int availableWidth = c.getWidth();
      if (selectedTask.getBandCount() > 0) {
        RibbonBandResizeSequencingPolicy resizeSequencingPolicy = selectedTask
            .getResizeSequencingPolicy();
        resizeSequencingPolicy.reset();
        AbstractRibbonBand<?> currToTakeFrom = resizeSequencingPolicy
            .next();
        while (true) {
          // check whether all bands have the current resize
          // policy as their last (most restrictive) registered policy
          boolean noMore = true;
          for (AbstractRibbonBand<?> band : selectedTask.getBands()) {
            RibbonBandResizePolicy currentResizePolicy = band
                .getCurrentResizePolicy();
            List<RibbonBandResizePolicy> resizePolicies = band
                .getResizePolicies();
            if (currentResizePolicy != resizePolicies
                .get(resizePolicies.size() - 1)) {
              noMore = false;
              break;
            }
          }
          if (noMore)
            break;

          // get the current preferred width of the bands
          int totalWidth = 0;
          // System.out.println("Iteration");
          for (AbstractRibbonBand<?> ribbonBand : selectedTask
              .getBands()) {
            RibbonBandResizePolicy currentResizePolicy = ribbonBand
                .getCurrentResizePolicy();

            Insets ribbonBandInsets = ribbonBand.getInsets();
            AbstractBandControlPanel controlPanel = ribbonBand
                .getControlPanel();
            if (controlPanel == null) {
              controlPanel = ribbonBand.getPopupRibbonBand()
                  .getControlPanel();
            }
            Insets controlPanelInsets = controlPanel.getInsets();
            int controlPanelGap = controlPanel.getUI()
                .getLayoutGap();
            int ribbonBandHeight = availableBandHeight
                - ribbonBandInsets.top
                - ribbonBandInsets.bottom;
            int availableHeight = ribbonBandHeight
                - ribbonBand.getUI().getBandTitleHeight();
            if (controlPanel != null) {
              availableHeight = availableHeight
                  - controlPanelInsets.top
                  - controlPanelInsets.bottom;
            }
            int preferredWidth = currentResizePolicy
                .getPreferredWidth(availableHeight,
                    controlPanelGap)
                + ribbonBandInsets.left
                + ribbonBandInsets.right;
            totalWidth += preferredWidth + bandGap;
            // System.out.println("\t"
            // + ribbonBand.getTitle()
            // + ":"
            // + currentResizePolicy.getClass()
            // .getSimpleName() + ":" + preferredWidth
            // + " under " + availableHeight + " with "
            // + controlPanel.getComponentCount()
            // + " children");
          }
          // System.out.println("\t:Total:" + totalWidth + "("
          // + availableWidth + ")");
          // System.out.println("\n");
          if (totalWidth < availableWidth)
            break;

          // try to take from the currently rotating band
          List<RibbonBandResizePolicy> policies = currToTakeFrom
              .getResizePolicies();
          int currPolicyIndex = policies.indexOf(currToTakeFrom
              .getCurrentResizePolicy());
          if (currPolicyIndex == (policies.size() - 1)) {
            // nothing to take
          } else {
            currToTakeFrom.setCurrentResizePolicy(policies
                .get(currPolicyIndex + 1));
          }
          currToTakeFrom = resizeSequencingPolicy.next();
        }
      }

      boolean ltr = c.getComponentOrientation().isLeftToRight();
      x = ltr ? 1 : c.getWidth() - 1;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.