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

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


      e.printStackTrace();
      return null;
    }
    final int height = image.getHeight(null);
    final int width = image.getWidth(null);
    final ResizableIcon resizeIcon = ImageWrapperResizableIcon.getIcon(
        image, new Dimension(width, height));
    return resizeIcon;
  }
View Full Code Here


   * Creates the expand button for the associated ribbon band.
   *
   * @return Expand button for the associated ribbon band.
   */
  protected JCommandButton createExpandButton() {
    ResizableIcon icon = FlamingoUtilities
        .getRibbonBandExpandIcon(this.ribbonBand);
    JCommandButton result = new JCommandButton(null, icon);
    result.setFlat(true);
    result.putClientProperty(BasicCommandButtonUI.EMULATE_SQUARE_BUTTON,
        Boolean.TRUE);
View Full Code Here

   * Installs subcomponents on the associated command button.
   */
  protected void installComponents() {
    this.updatePopupActionIcon();

    ResizableIcon buttonIcon = this.commandButton.getIcon();
    if (buttonIcon instanceof AsynchronousLoading) {
      ((AsynchronousLoading) buttonIcon)
          .addAsynchronousLoadListener(new AsynchronousLoadListener() {
            public void completed(boolean success) {
              if (success && (commandButton != null))
View Full Code Here

      return;
    }
  }

  protected void syncDisabledIcon() {
    ResizableIcon currDisabledIcon = this.commandButton.getDisabledIcon();
    ResizableIcon icon = this.commandButton.getIcon();
    if ((currDisabledIcon == null)
        || (currDisabledIcon instanceof UIResource)) {
      if (icon != null) {
        this.commandButton.setDisabledIcon(new ResizableIconUIResource(
            new FilteredResizableIcon(icon, new ColorConvertOp(
                ColorSpace.getInstance(ColorSpace.CS_GRAY),
                null))));
      } else {
        this.commandButton.setDisabledIcon(null);
      }
    } else {
      // disabled icon coming from app code
      if (icon != null) {
        this.commandButton.getDisabledIcon()
            .setDimension(
                new Dimension(icon.getIconWidth(), icon
                    .getIconHeight()));
      }
    }
  }
View Full Code Here

      }
    }
  }

  protected void syncIconDimension() {
    ResizableIcon icon = this.commandButton.getIcon();
    CommandButtonDisplayState commandButtonState = this.commandButton
        .getDisplayState();

    this.layoutManager = commandButtonState
        .createLayoutManager(this.commandButton);

    if (icon == null)
      return;

    int maxHeight = layoutManager.getPreferredIconSize();
    if (maxHeight < 0) {
      maxHeight = this.commandButton.getIcon().getIconHeight();
    }

    if (commandButtonState != CommandButtonDisplayState.FIT_TO_ICON) {
      Dimension newDim = new Dimension(maxHeight, maxHeight);
      icon.setDimension(newDim);
    }
  }
View Full Code Here

  }

  private JCommandButton createActionOnlyButton(String text,
      CommandButtonDisplayState state,
      CommandButtonKind commandButtonKind, int fontSize) {
    ResizableIcon mainPasteIcon = SvgBatikResizableIcon.getSvgIcon(
        TestCommandButtons.class.getClassLoader().getResource(
            "test/svg/edit-paste.svg"), new Dimension(32, 32));
    JCommandButton mainButton = new JCommandButton(text, mainPasteIcon);
    mainButton.setDisabledIcon(new FilteredResizableIcon(mainPasteIcon,
        new ColorConvertOp(ColorSpace.getInstance(ColorSpace.CS_GRAY),
View Full Code Here

    return prio;
  }
 
  public static JButton createButton(final AFreeplaneAction action) {
    String title = ActionUtils.getActionTitle(action);
    ResizableIcon icon = ActionUtils.getActionIcon(action);
   
    final JButton button = new JButton(title, icon);
   
//    updateRichTooltip(button, action, null);
    button.addActionListener(new RibbonActionListener(action));
View Full Code Here

    return button;
  }

  public static JCommandButton createCommandButton(final AFreeplaneAction action) {
    String title = ActionUtils.getActionTitle(action);
    ResizableIcon icon = ActionUtils.getActionIcon(action);
   
    final JCommandButton button = new JCommandButton(title, icon);
   
    updateRichTooltip(button, action, null);
    button.addActionListener(new RibbonActionListener(action));
View Full Code Here

    return button;
  }
 
  public static JCommandToggleButton createCommandToggleButton(final AFreeplaneAction action) {
    String title = ActionUtils.getActionTitle(action);
    ResizableIcon icon = ActionUtils.getActionIcon(action);
   
    final JCommandToggleButton button = new JCommandToggleButton(title, icon);
   
    updateRichTooltip(button, action, null);
    button.addActionListener(new RibbonActionListener(action));
View Full Code Here

    return button;
  }
 
  public static JCommandMenuButton createCommandMenuButton(final AFreeplaneAction action) {
    String title = ActionUtils.getActionTitle(action);
    ResizableIcon icon = ActionUtils.getActionIcon(action);
   
    final JCommandMenuButton button = new JCommandMenuButton(title, icon);
   
    updateRichTooltip(button, action, null);
    button.addActionListener(new RibbonActionListener(action));
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.