Package org.pushingpixels.flamingo.api.svg

Examples of org.pushingpixels.flamingo.api.svg.SvgBatikResizableIcon


    public SvgIconPanel() {
      this.setLayout(new SvgIconPanelLayout());
      try {
        FileInputStream fis = new FileInputStream(
            "C:/jtools/tango-icon-theme-0.8.0/scalable/actions/edit-paste.svg");
        SvgBatikResizableIcon icon = SvgBatikResizableIcon.getSvgIcon(
            fis, new Dimension(32, 32));
        iconButton = new JCommandButton("just icon", icon);
        iconButton.setDisplayState(CommandButtonDisplayState.BIG);
        add(iconButton);
      } catch (IOException ioe) {
View Full Code Here


    public SvgIconPanel() {
      this.setLayout(new SvgIconPanelLayout());
      try {
        FileInputStream fis = new FileInputStream(
            "C:/JTools/icons/oxygen/categories/applications-accessories.svgz");
        SvgBatikResizableIcon icon = SvgBatikResizableIcon.getSvgzIcon(
            fis, new Dimension(32, 32));
        iconButton = new JCommandButton("just icon", icon);
        iconButton.setDisplayState(CommandButtonDisplayState.BIG);
        add(iconButton);
      } catch (IOException ioe) {
View Full Code Here

        for (final StringValuePair<InputStream> pair : pairs) {
          final String name = pair.getKey();
          InputStream svgStream = pair.getValue();
          Dimension svgDim = new Dimension(currDimension,
              currDimension);
          final SvgBatikResizableIcon svgIcon = name.endsWith(".svg") ? SvgBatikResizableIcon
              .getSvgIcon(svgStream, svgDim)
              : SvgBatikResizableIcon.getSvgzIcon(svgStream,
                  svgDim);
          JCommandButton svgButton = newButtons.get(name);
          svgButton.setIcon(svgIcon);

          RichTooltip richTooltip = new RichTooltip("Transcode",
              "Click to generate Java2D class");
          svgButton.setActionRichTooltip(richTooltip);
          svgButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
              try {
                System.out.println(name);
                String svgClassName = name.substring(0, name
                    .lastIndexOf('.'));
                svgClassName = svgClassName.replace('-', '_');
                svgClassName = svgClassName.replace(' ', '_');

                String javaClassFilename = System
                    .getProperty("java.io.tmpdir")
                    + File.separator
                    + svgClassName
                    + ".java";

                PrintWriter pw = new PrintWriter(
                    javaClassFilename);

                SvgStreamTranscoder transcoder = new SvgStreamTranscoder(
                    new ByteArrayInputStream(svgIcon
                        .getSvgBytes()), svgClassName);

                transcoder.setPrintWriter(pw);
                transcoder.transcode();
                JOptionPane
View Full Code Here

TOP

Related Classes of org.pushingpixels.flamingo.api.svg.SvgBatikResizableIcon

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.