简体   繁体   English

自定义外观,无需继承

[英]Custom look and feel without inheritance

How can I make my own look and feel without inheriting any previous look and feel? 我如何在不继承以前的外观的情况下做出自己的外观? I know that it's like "re-inventing the wheel" but I don't actually like any of the existing free look and feels. 我知道这就像“重新发明轮子”,但实际上我不喜欢任何现有的自由外观。 Any help would be appreciated! 任何帮助,将不胜感激!

I've done a laf ( http://nilogonzalez.es/nimrodlf/index.html ) and, well, if you want to write a laf from scratch you have my respect... 我已经完成了laf( http://nilogonzalez.es/nimrodlf/index.html ),而且,如果您想从头开始编写laf,请尊重...

The best approach is to extend Metal classes. 最好的方法是扩展金属类。 That way you will get a lot of work done and a bunch of hints of what to do. 这样一来,您将完成很多工作,并提示要做什么。 You will get a lot of components that paint a rectangle and handle events, so to do your laf you "just" have to change the paint* method to paint your laf, but you save an enormous amount of work. 您将获得很多绘制矩形和处理事件的组件,因此,要做“ laf”时,您“只是”不得不更改paint *方法来绘制laf,但是却节省了大量工作。

If you want to make your laf without using Metal as basement you will have to do... Well, look at the javadoc to figure the size of your project... 如果您想在不使用Metal作为地下室的情况下制造laf,那么就必须这样做...好吧,请看一下javadoc来确定项目的大小...

I recomend you to get the Kunststoff sources ( http://kunstoff.incors.com/ ) to take a look of what you have to do. 我建议您获得Kunststoff的资源( http://kunstoff.incors.com/ ),以了解您必须做的事情。 Kunststoff is enough simple to get an idea of what to do, and is very candy even in components that simple have a few lines of code. Kunststoff足够简单,可以让您知道该怎么做,即使在简单的组件中只有几行代码,它也非常有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM