Examples of RibbonContextualTaskGroup


Examples of org.pushingpixels.flamingo.api.ribbon.RibbonContextualTaskGroup

  /* TASKGROUP */
  /*************/
  private RibbonContextualTaskGroup getTokengameGroup() {
   
    if (tokengameGroup == null) {
      tokengameGroup = new RibbonContextualTaskGroup("", Color.green, getTokengameTask());
    }
   
    return tokengameGroup;
  }
View Full Code Here

Examples of org.pushingpixels.flamingo.api.ribbon.RibbonContextualTaskGroup

        // System.out.println("Added " + task.getTitle());
      }
      // add all tasks of visible contextual groups except last task in
      // each group
      for (int i = 0; i < ribbon.getContextualTaskGroupCount(); i++) {
        RibbonContextualTaskGroup group = ribbon
            .getContextualTaskGroup(i);
        if (ribbon.isVisible(group)) {
          for (int j = 0; j < group.getTaskCount() - 1; j++) {
            RibbonTask task = group.getTask(j);
            tasksWithTrailingSeparators.add(task);
            // System.out.println("Added " + task.getTitle());
          }
        }
      }
View Full Code Here

Examples of org.pushingpixels.flamingo.api.ribbon.RibbonContextualTaskGroup

     * @param g
     *            Graphics context.
     */
    protected void paintContextualTaskGroupsOutlines(Graphics g) {
      for (int i = 0; i < ribbon.getContextualTaskGroupCount(); i++) {
        RibbonContextualTaskGroup group = ribbon
            .getContextualTaskGroup(i);
        if (!ribbon.isVisible(group))
          continue;
        // go over all the tasks in this group and compute the union
        // of bounds of the matching tab buttons
View Full Code Here

Examples of org.pushingpixels.flamingo.api.ribbon.RibbonContextualTaskGroup

    g2d.setColor(FlamingoUtilities.getBorderColor());
    g2d.draw(outerContour);

    // check whether the currently selected task is a contextual task
    RibbonTask selected = this.ribbon.getSelectedTask();
    RibbonContextualTaskGroup contextualGroup = selected
        .getContextualGroup();
    if (contextualGroup != null) {
      // paint a small gradient directly below the task area
      Insets ins = this.ribbon.getInsets();
      int topY = ins.top + getTaskbarHeight();
      int bottomY = topY + 5;
      Color hueColor = contextualGroup.getHueColor();
      Paint paint = new GradientPaint(0, topY, FlamingoUtilities
          .getAlphaColor(hueColor,
              (int) (255 * RibbonContextualTaskGroup.HUE_ALPHA)),
          0, bottomY, FlamingoUtilities.getAlphaColor(hueColor, 0));
      g2d.setPaint(paint);
View Full Code Here

Examples of org.pushingpixels.flamingo.api.ribbon.RibbonContextualTaskGroup

        bandHostPanel.add(band);
        band.setVisible(selectedTask == task);
      }
    }
    for (int i = 0; i < this.ribbon.getContextualTaskGroupCount(); i++) {
      RibbonContextualTaskGroup taskGroup = this.ribbon
          .getContextualTaskGroup(i);
      for (int j = 0; j < taskGroup.getTaskCount(); j++) {
        RibbonTask task = taskGroup.getTask(j);
        for (AbstractRibbonBand band : task.getBands()) {
          bandHostPanel.add(band);
          band.setVisible(selectedTask == task);
        }
      }
View Full Code Here

Examples of org.pushingpixels.flamingo.api.ribbon.RibbonContextualTaskGroup

      RibbonTask task = this.ribbon.getTask(i);
      result.add(task);
    }
    // add all tasks of visible contextual groups
    for (int i = 0; i < this.ribbon.getContextualTaskGroupCount(); i++) {
      RibbonContextualTaskGroup group = this.ribbon
          .getContextualTaskGroup(i);
      if (this.ribbon.isVisible(group)) {
        for (int j = 0; j < group.getTaskCount(); j++) {
          RibbonTask task = group.getTask(j);
          result.add(task);
        }
      }
    }
View Full Code Here

Examples of org.pushingpixels.flamingo.api.ribbon.RibbonContextualTaskGroup

        g2d.setComposite(AlphaComposite.SrcOver);
        // the taskbar panel is not at the zero X coordinate of the
        // ribbon
        g2d.translate(-this.getBounds().x, 0);
        for (int i = 0; i < ribbon.getContextualTaskGroupCount(); i++) {
          RibbonContextualTaskGroup taskGroup = ribbon
              .getContextualTaskGroup(i);
          if (!ribbon.isVisible(taskGroup))
            continue;
          Rectangle taskGroupBounds = getContextualTaskGroupBounds(taskGroup);

          Color hueColor = taskGroup.getHueColor();
          Paint paint = new GradientPaint(
              0,
              0,
              FlamingoUtilities.getAlphaColor(hueColor, 0),
              0,
              height,
              FlamingoUtilities
                  .getAlphaColor(
                      hueColor,
                      (int) (255 * RibbonContextualTaskGroup.HUE_ALPHA)));
          // translucent gradient paint
          g2d.setPaint(paint);
          int startX = ltr ? taskGroupBounds.x : Math.min(
              contourMinX, taskGroupBounds.x);
          int width = ltr ? taskGroupBounds.x + taskGroupBounds.width
              - startX : Math.min(taskGroupBounds.x
              + taskGroupBounds.width, contourMinX)
              - startX;

          if (width > 0) {
            g2d.fillRect(startX, 0, width, height);
            // and a solid line at the bottom
            g2d.setColor(hueColor);
            g2d.drawLine(startX + 1, height - 1, startX + width,
                height - 1);

            // task group title
            g2d.setColor(FlamingoUtilities.getColor(Color.black,
                "Button.foreground"));
            FontMetrics fm = this.getFontMetrics(ribbon.getFont());
            int yOffset = (height + fm.getHeight()) / 2
                - fm.getDescent();
            int availableTextWidth = width - 10;
            String titleToShow = taskGroup.getTitle();
            if (fm.stringWidth(titleToShow) > availableTextWidth) {
              while (true) {
                if (titleToShow.length() == 0)
                  break;
                if (fm.stringWidth(titleToShow + "...") <= availableTextWidth)
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.