Examples of ResizableIcon


Examples of org.jvnet.flamingo.common.icon.ResizableIcon

         
    try{
      URL btnIconResourceUrl = getClass().getClassLoader().getResource(
          ActivityLabel.getSVGIconPath(value.getClass()));
     
      ResizableIcon btnSVGIcon = null;
     
      if(btnIconResourceUrl != null) {
        btnSVGIcon = SvgBatikResizableIcon.getSvgIcon(
            btnIconResourceUrl, new Dimension(24, 24));
      }
View Full Code Here

Examples of org.jvnet.flamingo.common.icon.ResizableIcon

          }
        //}
        URL btnIconResourceUrl = getClass().getClassLoader().getResource(
              ActivityLabel.getSVGIconPath(activityCls));
       
        ResizableIcon btnSVGIcon = null;
       
        if(btnIconResourceUrl != null) {
          btnSVGIcon = SvgBatikResizableIcon.getSvgIcon(btnIconResourceUrl, new Dimension(32, 32));
        }
       
        if(btnSVGIcon == null){  //if there's no SVG icon for requested activity type, try to use the GIF image icon instead.
          ImageIcon activityGifImageIcon = ActivityLabel.getImageIcon(activityCls);
          if(activityGifImageIcon!=null)
            btnSVGIcon = new IconWrapperResizableIcon(activityGifImageIcon);
        }

        if(btnSVGIcon == null){  //if there's no icon even, use default one.
          URL defaultIconResourceUrl = getClass().getClassLoader().getResource(
              ActivityLabel.getSVGIconPath(DefaultActivity.class));
         
          if(defaultIconResourceUrl!=null)
            btnSVGIcon = SvgBatikResizableIcon.getSvgIcon(defaultIconResourceUrl, new Dimension(32, 32));
        }

        if(btnSVGIcon != null) {
          JCommandButton btn = new JCommandButton(name, btnSVGIcon);
          activityTypeNameMap.put(activityCls, name);
          btn.setToolTipText(clsName);
          btn.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent ae){
              ProcessDesigner.this.insertActivity(activityCls);
              ProcessDesigner.this.setDocumentChanged(true);
            }         
          });
         
          DragSource dragSource = DragSource.getDefaultDragSource();
          dragSource.createDefaultDragGestureRecognizer(
            btn, // component where drag originates
            DnDConstants.ACTION_COPY_OR_MOVE, // actions
            new DragGestureListener(){
              /**
               * start of D&D framework implementation
               */
             
              public void dragGestureRecognized(DragGestureEvent e) {
                e.startDrag(DragSource.DefaultCopyDrop, // cursor
                  new Transferable(){

                    public DataFlavor[] getTransferDataFlavors() {
                      // TODO Auto-generated method stub
                      return null;
                    }

                    public boolean isDataFlavorSupported(DataFlavor flavor) {
                      // TODO Auto-generated method stub
                      return false;
                    }

                    public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException {
                      List list = new ArrayList();
                      list.add(activityCls);
                      return list;
                    }
                 
                  })// drag source listener
              }
              public void dragDropEnd(DragSourceDropEvent e) {}
              public void dragEnter(DragSourceDragEvent e) {}
              public void dragExit(DragSourceEvent e) {}
              public void dragOver(DragSourceDragEvent e) {}
              public void dropActionChanged(DragSourceDragEvent e) {}

              /**
               * end of D&D framework implementation
               */
            }
          ); // drag gesture recognizer
         
          if(!activityByBand.containsKey(bandName)){
            URL bandIconResourceUrl = getClass().getClassLoader().getResource(
                ActivityLabel.getSVGIconPath(activityCls, bandIconName));
           
            ResizableIcon bandSVGIcon = null;

            if(bandIconResourceUrl!=null){
              bandSVGIcon = SvgBatikResizableIcon.getSvgIcon(
                  bandIconResourceUrl, new Dimension(25, 25));
            }
View Full Code Here

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

    // create a new button
    URL cutIconUrl = CommandToggleButtonTestCase.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

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

    // create a new button
    URL cutIconUrl = CommandToggleButtonTestCase.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

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

    // create a new button
    URL cutIconUrl = CommandToggleButtonTestCase.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

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

    // create a new button
    URL cutIconUrl = CommandToggleButtonTestCase.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

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

  JCommandButton button;

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

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

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

  @Before
  public void onSetUp() {
    URL resource = CommandToggleButtonTestCase.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

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

        });

    URL cutIconUrl = CommandToggleButtonTestCase.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

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

  @Before
  public void onSetUp() {
    URL resource = PopupCommandButtonTestCase.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
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.