do you mean something like:
var weighty = forward to peer
instead of:
def weighty: Double = peer.weighty
def weighty_=(y: Double) { peer.weighty = y }
?
--
Eugen
No problem!
> /Although/ maybe some sort of easy forwarding accessor mechanism would be a useful thing.
I'm with you. But how to implement this?
Another view on the problem: var weighty can be seen as an alias for peer.weighty.
We are able to declare an alias for a type. Then why not to introduce an aliasing mechanism for
variables?
something like this? https://github.com/kevinwright/Autoproxy-Lite
You want to look into regular asymmetric lenses. The variable in your use-case throws a furfy though.
I heard that lenses reinvented javabeans or something like that.
You want to look into regular asymmetric lenses. The variable in your use-case throws a furfy though.
I heard that lenses reinvented javabeans or something like that.
GridBagLayout is just fine and far less complicated than most people claim it is.
Date: Tue, 6 Mar 2012 20:57:53 -0800
From: eric.ko...@gmail.com
To: scala...@googlegroups.com
Subject: Re: [scala-user] Simple way to get automatical getters/setters.
This is slightly off topic - but
Don't ever use GridBagLayout in Swing - unless you have a high tolerance to pain, or you like writing abstruse code.
Use MigLayout instead, and avoid the pain, as well as the need for getters and setters.
Cheers, Eric
I have spent endless hours trying to reverse engineer some abysmal GriefBagLayout people have twisted and tied into some wretched UI implementation and gone crazy trying to figure out what was wrong, only to end up having to re-implement the UI, usually in MigLayout.</SoapBox>
I have spent endless hours trying to convince GriefBagLayout to perform what I thought were simple layouts, only to end up feeling stupid and inadequate. Since I have sworn off GriefBagLayout forever and switched to MigLayout my mental and emotional health have improved. For the most part MigLayout can replace most or all of the standard Java layout managers, and the resulting code is cleaner, more concise and more readable. Using GriefBagLayout is like coding in assembly language, while using MigLayout is like coding in Scala.
Sorry Chris, maybe you are a genius with GriefBagLayout, but I am not, and I have met dozens of other developers who hate GriefBagLayout as passionately as I do.
I suspect there is someone out there right now on the Clojure mailing list or wherever saying the following:
"I have spent endless hours trying to reverse engineer some abysmal MigLayout people have twisted and tied into some wretched UI implementation and gone crazy trying to figure out what was wrong, only to end up having to re-implement the UI, usually in GridBagLayout "
I am not a "GridBagLayout genius". GridBagLayouts are easy to use. I strongly suspect that the programmers who ruined your days would have done so whatever layout mechanism they would have (presumably mis-) used. You get MigLayout and like it: great! Do I get MigLayout? Not really - why would I want layout information in a String?