コード例 #1
0
    @Override
    protected void paintContextualTaskGroupOutlines(
        Graphics g, RibbonContextualTaskGroup group, Rectangle groupBounds) {
      Graphics2D g2d = (Graphics2D) g.create();

      // SubstanceColorScheme scheme = SubstanceColorSchemeUtilities
      // .getBorderColorScheme(ribbon, ComponentState.DEFAULT);

      g2d.translate(groupBounds.x, 0);
      SeparatorPainterUtils.paintSeparator(
          ribbon,
          g2d,
          2,
          groupBounds.height * 3 / 4,
          SwingConstants.VERTICAL,
          false,
          0,
          groupBounds.height / 3,
          true);

      g2d.translate(groupBounds.width - 1, 0);
      SeparatorPainterUtils.paintSeparator(
          ribbon,
          g2d,
          2,
          groupBounds.height * 3 / 4,
          SwingConstants.VERTICAL,
          false,
          0,
          groupBounds.height / 3,
          true);

      g2d.dispose();
    }
コード例 #2
0
  /*
   * (non-Javadoc)
   *
   * @seeorg.jvnet.flamingo.common.ui.BasicCommandButtonUI#
   * paintButtonVerticalSeparator(java.awt.Graphics, int)
   */
  @Override
  protected void paintButtonVerticalSeparator(Graphics graphics, Rectangle separatorArea) {
    Graphics2D g2d = (Graphics2D) graphics.create();
    g2d.translate(separatorArea.x, 0);

    SubstanceColorScheme colorScheme =
        SubstanceColorSchemeUtilities.getColorScheme(
            this.commandButton,
            ColorSchemeAssociationKind.SEPARATOR,
            ComponentState.getState(this.commandButton.getActionModel(), this.commandButton));

    float fadeAlpha = this.getSeparatorAlpha();
    g2d.setComposite(AlphaComposite.SrcOver.derive(fadeAlpha));

    SeparatorPainterUtils.paintSeparator(
        this.commandButton,
        g2d,
        colorScheme,
        1,
        this.commandButton.getHeight(),
        JSlider.VERTICAL,
        true,
        4,
        4,
        true);

    g2d.dispose();
  }
コード例 #3
0
 /*
  * (non-Javadoc)
  *
  * @see
  * org.jvnet.flamingo.ribbon.ui.BasicRibbonUI#paintMinimizedRibbonSeparator
  * (java.awt.Graphics)
  */
 @Override
 protected void paintMinimizedRibbonSeparator(Graphics g) {
   Graphics2D g2d = (Graphics2D) g.create();
   g2d.translate(0, this.ribbon.getHeight() - 1);
   SeparatorPainterUtils.paintSeparator(
       this.ribbon, g2d, this.ribbon.getWidth(), 0, JSeparator.HORIZONTAL, false, 0);
   g2d.dispose();
 }
コード例 #4
0
    @Override
    protected void paintTaskOutlines(Graphics g) {
      Graphics2D g2d = (Graphics2D) g.create();
      SubstanceColorScheme scheme =
          SubstanceColorSchemeUtilities.getColorScheme(
              ribbon, ColorSchemeAssociationKind.SEPARATOR, ComponentState.ENABLED);

      Set<RibbonTask> tasksWithTrailingSeparators = new HashSet<RibbonTask>();
      // add all regular tasks except the last
      for (int i = 0; i < ribbon.getTaskCount() - 1; i++) {
        RibbonTask task = ribbon.getTask(i);
        tasksWithTrailingSeparators.add(task);
        // 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);
          }
        }
      }

      for (RibbonTask taskWithTrailingSeparator : tasksWithTrailingSeparators) {
        JRibbonTaskToggleButton taskToggleButton = taskToggleButtons.get(taskWithTrailingSeparator);
        Rectangle bounds = taskToggleButton.getBounds();
        int x = bounds.x + bounds.width + getTabButtonGap() / 2 - 1;
        g2d.translate(x, 0);
        SeparatorPainterUtils.paintSeparator(
            ribbon,
            g2d,
            scheme,
            2,
            getHeight(),
            SwingConstants.VERTICAL,
            false,
            getHeight() / 3,
            0,
            true);
        g2d.translate(-x, 0);
      }

      g2d.dispose();
    }