Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more colour schemes to IDE. #3

Open
Abhey opened this issue Oct 19, 2017 · 2 comments
Open

Add more colour schemes to IDE. #3

Abhey opened this issue Oct 19, 2017 · 2 comments

Comments

@Abhey
Copy link
Owner

Abhey commented Oct 19, 2017

No description provided.

@kanishkarj
Copy link

how are we supposed to do it? and where do I define the new schemes?

@Abhey
Copy link
Owner Author

Abhey commented Oct 19, 2017

I have created a constructor in SyntaxDocument class which takes an array of MutableAttributeSet as an argument. So whenever a user select a particular colour scheme from a menu item then all you need to do is create a MutableAttributeSet array, the first entry will corresponds to properties of how normal text is displayed, second one corresponds to comments, third one corresponds to keywords and fourth one corresponds to quote. Then all you need to do is create a new SyntaxDocument for each of the TextPane and then change the StyledDocument of the TextPane with the newly created one. How you store the properties for color scheme is up to you. It may be hard coded because there are only four colour schemes right now or you may also store them in a text file which would turn out beneficial in long run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants