GlyphButton - prihoada/NotEd GitHub Wiki
Swing tlačítka umožňující vykreslení symbolů music rendereru.
- GlyphButton
- Standardní tlačítko
- GlyphToggleButton
- Zamačkávací tlačítko
Základní použití:
GlyphToggleButton Whole = new GlyphToggleButton();
Whole.setGlyph(new NoteGlyph(Duration.Whole, 1));
Whole.setPreferredSize(new Dimension(40, 40));
GlyphButton button = new GlyphButton();
button.setGlyph(new ClefGlyph(Clef.G2));
button.setGlyphScale(0.5f);
button.setPreferredSize(new Dimension(40, 40));
Poznámka: GlyphButton a podobné třidy vyžadují nastavení velikosti pomocí metody setPrefferedSize()
Všechny možnosti:
GlyphButton button1 = new GlyphButton();
NoteGlyph noteGlyph = new NoteGlyph(Duration.Quarter,
noteGlyph.setY(9); // posunutí Y dolů
noteGlyph.setX(-4); // posunutí X vlevo
button1.setGlyph(noteGlyph);
button1.setPreferredSize(new Dimension(40, 40));
button1.setGlyphScale(0.8f);