阅读背景:

设计模式在更改一个对象的属性时替换重复代码

来源:互联网 

I have 4 custom spinners which modify the width, height, X location and Y location of one selected widget. My widget can be dragged around the screen, and the idea is to use these spinners to change certain properties such as width or height, and see immediate effect on the changes. Is there a pattern that I can use to replace all these classes (XSpinnerListener, YSpinnerListener...) with only one and indicate which property of my current object (a JButton) needs to change? Is this a good design approach?I have 4 custom spinners which modify the width




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: