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

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


  JCommandButton button2;

  @Override
  @Before
  public void onSetUp() {
    final ResizableIcon icon1 = new edit_paste();
    final ResizableIcon icon2 = new edit_cut();

    GuiActionRunner.execute(new GuiTask() {
      @Override
      protected void executeInEDT() throws Throwable {
        buttonFrame = new JFrame();
View Full Code Here


  @Before
  public void onSetUp() {
    URL resource = ActionCommandButtonTestCase.class.getClassLoader()
        .getResource("utest/common/edit-paste.svg");
    Assertions.assertThat(resource).isNotNull();
    final ResizableIcon icon = SvgBatikResizableIcon.getSvgIcon(resource,
        new Dimension(32, 32));
    Pause.pause(new Condition("Waiting to load the SVG icon") {
      @Override
      public boolean test() {
        return !((AsynchronousLoading) icon).isLoading();
View Full Code Here

        });

    URL cutIconUrl = ActionCommandButtonTestCase.class.getClassLoader()
        .getResource("utest/common/edit-cut.svg");
    Assertions.assertThat(cutIconUrl).isNotNull();
    final ResizableIcon cutIcon = SvgBatikResizableIcon.getSvgIcon(
        cutIconUrl, new Dimension(16, 16));
    Pause.pause(new Condition("Waiting to load the SVG icon") {
      @Override
      public boolean test() {
        return !((AsynchronousLoading) cutIcon).isLoading();
View Full Code Here

  JCommandButton button2;

  @Override
  @Before
  public void onSetUp() {
    final ResizableIcon icon1 = new edit_paste();
    final ResizableIcon icon2 = new edit_cut();

    GuiActionRunner.execute(new GuiTask() {
      @Override
      protected void executeInEDT() throws Throwable {
        buttonFrame = new JFrame();
View Full Code Here

        JCommandButton button = new JCommandButton(bi.getKey());
        configureBreadcrumbButton(button);
        configureMainAction(button, bi);
        final Icon icon = bi.getIcon();
        if (icon != null) {
          button.setIcon(new ResizableIcon() {
            int iw = icon.getIconWidth();
            int ih = icon.getIconHeight();

            @Override
            public void paintIcon(Component c, Graphics g, int x,
View Full Code Here

          JCommandMenuButton menuButton = new JCommandMenuButton(bi
              .getKey(), null);
          final Icon icon = bi.getIcon();
          if (icon != null) {
            menuButton.setIcon(new ResizableIcon() {
              int iw = icon.getIconWidth();
              int ih = icon.getIconHeight();

              @Override
              public void paintIcon(Component c, Graphics g,
View Full Code Here

      protected void process(List<Leaf> leaves) {
        for (final Leaf leaf : leaves) {
          final String name = leaf.getLeafName();
          InputStream stream = leaf.getLeafStream();
          Dimension dim = new Dimension(currDimension, currDimension);
          final ResizableIcon icon = getResizableIcon(leaf, stream,
              currState, dim);
          if (icon == null)
            continue;
          final JCommandButton commandButton = newButtons.get(name);
          commandButton.setIcon(icon);
View Full Code Here

    for (int groupIndex = 0; groupIndex < 4; groupIndex++) {
      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

   *            New default icon for this button.
   * @see #setDisabledIcon(ResizableIcon)
   * @see #getIcon()
   */
  public void setIcon(ResizableIcon defaultIcon) {
    ResizableIcon oldValue = this.icon;
    this.icon = defaultIcon;

    firePropertyChange("icon", oldValue, defaultIcon);
    if (defaultIcon != oldValue) {
      if (defaultIcon == null || oldValue == null
          || defaultIcon.getIconWidth() != oldValue.getIconWidth()
          || defaultIcon.getIconHeight() != oldValue.getIconHeight()) {
        revalidate();
      }
      repaint();
    }
  }
View Full Code Here

   *            the name of the resources
   * @return the item load or <code>null</code> in case it did not work
   */
  public static ResizableIcon getResizableIconFromResource(
      final String resource) {
    final ResizableIcon resizeIcon = SvgBatikResizableIcon.getSvgIcon(
        FlamingoBugSvg.class.getClassLoader().getResource(
            "test/svg/edit-paste.svg"), new Dimension(16, 16));
    return resizeIcon;
  }
View Full Code Here

TOP

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

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.