Created
February 8, 2012 17:02
-
-
Save kthoms/1771065 to your computer and use it in GitHub Desktop.
Spray_Listing_Styles_BlackAndWhiteStyle_Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IGaService gaService = Graphiti.getGaService(); | |
// Creating Style with given id and description | |
Style style = super.getStyle(diagram); | |
style.setId("BlackAndWhiteStyle"); | |
style.setDescription("A style with white background and black foreground."); | |
// transparency value | |
style.setTransparency(0.95); | |
// background attributes | |
style.setFilled(true); | |
style.setBackground(gaService.manageColor(diagram, IColorConstant.BLACK)); | |
// line attributes | |
style.setLineVisible(true); | |
style.setForeground(gaService.manageColor(diagram, IColorConstant.BLACK)); | |
style.setLineWidth(1); | |
style.setLineStyle(LineStyle.SOLID); | |
// font attributes | |
String fontName = "Tahoma"; | |
int fontSize = 10; | |
boolean fontItalic = true; | |
boolean fontBold = true; | |
style.setFont(gaService.manageFont(diagram, fontName, fontSize, fontItalic, fontBold)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment