Package org.pushingpixels.flamingo.api.common.icon

Examples of org.pushingpixels.flamingo.api.common.icon.DecoratedResizableIcon


      String iconGroupName = mf.format(new Object[] { groupIndex });
      this.addButtonGroup(iconGroupName, groupIndex);
      for (int i = 0; i < 15; i++) {
        final String deco = groupIndex + "/" + i;
        ResizableIcon fontIcon = new font_x_generic();
        ResizableIcon finalIcon = new DecoratedResizableIcon(fontIcon,
            new DecoratedResizableIcon.IconDecorator() {
              @Override
              public void paintIconDecoration(Component c,
                  Graphics g, int x, int y, int width,
                  int height) {
View Full Code Here


    this.buttons = new JCommandToggleButton[4][10];
    for (int i = 0; i < 4; i++) {
      for (int j = 0; j < 10; j++) {
        this.buttons[i][j] = new JCommandToggleButton("Button " + i
            + ":" + j, new DecoratedResizableIcon(
            new DisabledResizableIcon(RibbonElementPriority.TOP,
                32, 32), new TopLeftDecoration(i),
            new BottomRightDecoration(j)));
      }
    }

    this.ribbonBand = new JRibbonBand("Band", new EmptyResizableIcon(32));

    Map<RibbonElementPriority, Integer> visibleButtonCounts = new HashMap<RibbonElementPriority, Integer>();
    visibleButtonCounts.put(RibbonElementPriority.LOW, 4);
    visibleButtonCounts.put(RibbonElementPriority.MEDIUM, 5);
    visibleButtonCounts.put(RibbonElementPriority.TOP, 6);

    List<StringValuePair<List<JCommandToggleButton>>> galleryButtons = new ArrayList<StringValuePair<List<JCommandToggleButton>>>();
    for (int i = 0; i < 4; i++) {
      List<JCommandToggleButton> galleryButtonsList = new ArrayList<JCommandToggleButton>();
      for (int j = 0; j < 10; j++) {
        galleryButtonsList.add(this.buttons[i][j]);
      }
      galleryButtons.add(new StringValuePair<List<JCommandToggleButton>>(
          "Group " + i, galleryButtonsList));
    }

    this.ribbonBand.addRibbonGallery(GALLERY_NAME, galleryButtons,
        visibleButtonCounts, 6, 4, RibbonElementPriority.TOP);

    this.gallery = this.ribbonBand.getControlPanel().getRibbonGallery(
        GALLERY_NAME);

    this.getRibbon().addTask(new RibbonTask("Task 1", this.ribbonBand));

    JPanel controlPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
    JButton addToGroup0 = new JButton("Add one to 0");
    addToGroup0.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        JCommandToggleButton toAdd = new JCommandToggleButton(
            "Button 0 new", new DecoratedResizableIcon(
                new DisabledResizableIcon(
                    RibbonElementPriority.TOP, 32, 32),
                new TopLeftDecoration(0),
                new BottomRightDecoration(99)));
        ribbonBand.addRibbonGalleryButtons(GALLERY_NAME, "Group 0",
            toAdd);
      }
    });
    controlPanel.add(addToGroup0);

    JButton addToGroup2 = new JButton("Add two to 2");
    addToGroup2.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        JCommandToggleButton toAdd = new JCommandToggleButton(
            "Button 2 new", new DecoratedResizableIcon(
                new DisabledResizableIcon(
                    RibbonElementPriority.TOP, 32, 32),
                new TopLeftDecoration(2),
                new BottomRightDecoration(99)));
        JCommandToggleButton toAdd2 = new JCommandToggleButton(
            "Button 2 new 2", new DecoratedResizableIcon(
                new DisabledResizableIcon(
                    RibbonElementPriority.TOP, 32, 32),
                new TopLeftDecoration(2),
                new BottomRightDecoration(66)));
        ribbonBand.addRibbonGalleryButtons(GALLERY_NAME, "Group 2",
View Full Code Here

TOP

Related Classes of org.pushingpixels.flamingo.api.common.icon.DecoratedResizableIcon

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.