Package org.pushingpixels.flamingo.internal.ui.ribbon

Examples of org.pushingpixels.flamingo.internal.ui.ribbon.AbstractBandControlPanel


   **********************************************************************************/

  @SuppressWarnings("unchecked")
  protected void reorganizePolicies(JRibbonBand band, boolean tolerateExceptions) {
    Insets ins = band.getInsets();
    AbstractBandControlPanel controlPanel = band.getControlPanel();
    if (controlPanel == null)
      return;
    int height = controlPanel.getPreferredSize().height
        + band.getUI().getBandTitleHeight() + ins.top
        + ins.bottom;
    List<RibbonBandResizePolicy> resizePolicies = band.getResizePolicies();
    FlamingoUtilities.checkResizePoliciesConsistencyBase(band);
    int index = -1;
View Full Code Here


  }

  public static void checkResizePoliciesConsistency(
      AbstractRibbonBand ribbonBand) {
    Insets ins = ribbonBand.getInsets();
    AbstractBandControlPanel controlPanel = ribbonBand.getControlPanel();
    if (controlPanel == null)
      return;
    int height = controlPanel.getPreferredSize().height
        + ribbonBand.getUI().getBandTitleHeight() + ins.top
        + ins.bottom;
    List<RibbonBandResizePolicy> resizePolicies = ribbonBand
        .getResizePolicies();
    checkResizePoliciesConsistencyBase(ribbonBand);
View Full Code Here

              .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;
      // System.out.println("Will get [" + availableWidth + "]:");
      for (AbstractRibbonBand<?> ribbonBand : selectedTask.getBands()) {
        Insets ribbonBandInsets = ribbonBand.getInsets();
        RibbonBandResizePolicy currentResizePolicy = ribbonBand
            .getCurrentResizePolicy();
        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 - ribbonBandInsets.top
            - ribbonBandInsets.bottom
            - ribbonBand.getUI().getBandTitleHeight();
View Full Code Here

  }

  public static void checkResizePoliciesConsistency(
      AbstractRibbonBand ribbonBand) {
    Insets ins = ribbonBand.getInsets();
    AbstractBandControlPanel controlPanel = ribbonBand.getControlPanel();
    if (controlPanel == null)
      return;
    int height = controlPanel.getPreferredSize().height
        + ribbonBand.getUI().getBandTitleHeight() + ins.top
        + ins.bottom;
    List<RibbonBandResizePolicy> resizePolicies = ribbonBand
        .getResizePolicies();
    checkResizePoliciesConsistencyBase(ribbonBand);
View Full Code Here

TOP

Related Classes of org.pushingpixels.flamingo.internal.ui.ribbon.AbstractBandControlPanel

Copyright © 2018 www.massapicom. 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.