Giter VIP home page Giter VIP logo

svgicon's Introduction

SvgIcon

SvgIcon ist eine Java Bibliothek, mit dessen Hilfe man u.a. im Swing-Kontext SVG-Icons nutzen kann. Ich nahm ja eigentlich an, dass Swing das ootb kann, aber das war leider nicht der Fall. Ist ja auch schon etwas älter :). Und deswegen gibt es diese kleine Bibliothek. Diese Bibliothek wurde mit Java 17 getestet.

Screenshots

Installation

Das muss in die pom.xml:

<dependency>
    <groupId>de.schipplock.gui.swing</groupId>
    <artifactId>svgicon</artifactId>
    <version>0.0.4</version>
</dependency>

Wie verwende ich diese Bibliothek?

Es werden folgende Imports benötigt:

import de.schipplock.gui.swing.svgicon.SvgIconManager;
import de.schipplock.gui.swing.svgicon.SvgIcons;

Ein SVG-Icon laden:

// wenn man ein Icon braucht
var icon = SvgIconManager.getBuiltinIcon(SvgIcons.SVGICON_DATABASE, new Dimension(16, 16), "#419ee0");

// wenn man ein Image braucht
var image = SvgIconManager.getBuiltinIcon(SvgIcons.SVGICON_DATABASE, new Dimension(16, 16), "#419ee0").getImage();

// wenn man kein mitgeliefertes Icon nutzen möchte
var icon = SvgIconManager.getIcon("images/icon.svg");
var image = SvgIconManager.getIcon("images/icon.svg").getImage();

Fenster-Icons laden:

Angenommen wird, dass die Klasse JFrame erweitert.

setIconImages(SvgIconManager.getBuiltinWindowIconImages(SvgIcons.SVGICON_DATABASE, "#d15000"));
setIconImages(SvgIconManager.getWindowIconImages("images/logo.svg"));

Die Methode getWindowIconImages oder getBuiltinWindowIconImages stellt das gewünschte SVG-Icon in typischen Größen zur Verfügung (16x16, 32x32, 48x48, 256x256).

License

Apache License 2.0

svgicon's People

Contributors

schipplock avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.