[brailleblaster] Re: Accessing the GUI Environment in Windows

  • From: Chris von See <chris@xxxxxxxxxxxxx>
  • To: brailleblaster@xxxxxxxxxxxxx
  • Date: Thu, 24 Feb 2011 06:05:46 -0800

Normally, one creates a Display object using something like:

final Display d = new Display();

That Display object can then be used to create Shells and other SWT objects, such as Color and Font objects.

If that's not what you're looking for please send a complete code sample and a description of what you want to do and I'll try to help.


Cheers
Chris



On Feb 24, 2011, at 5:52 AM, John J. Boyer wrote:

Michael,

Display is a class in org.eclipse.swt.widgets I was hoping someone would
be familiar enough with swt to give a useful opinion.

This is just the start of coding, and I have not been coding Java that
long. Sone of the things you have noted are just incomplete.

John

On Thu, Feb 24, 2011 at 01:19:50PM +0000, Michael Whapples wrote:
You'll need to give better detail than this. When you say calling
Display() what do you mean by this, what class/object is it on? The name convention of a capital first letter suggests this is not a method call
but rather a constructor of a class.

Looking at the code in the repository did not help at all, to be honest its dreadful. There's an instance where you construct an instance of an object but never assign it to a variable, this is meaningless in object orientated design. A constructor should only do work which is necessary to prepare an object ready for use, therefore never assigning it means
you never use it, therefore why create it?

In the public static void main (psvm) where you enter BrailleBlaster you
have put some throws on it, is this really wanted, shouldn't
BrailleBlaster try and handle them and if users need to be informed/ need to make a decision then couldn't BrailleBlaster catch them and give more
user friendly error messages?

As well as this rather unusual use of an object orientated language, you have made it harder to read/understand in some more cosmetic ways: What
is the variable m? Indentation of blocks would also help quickly know
where one is in the complicated conditional blocks you have used.

I could go on but I feel it would get too long.

Michael Whapples
On 23/02/11 07:37, John J. Boyer wrote:
As noted, I have BrailleBlaster running on Windows so I can develop and test a prototype GUI. I have SWT in my classpath. However when I call Display() it returns null. Do I have to do something more than just call
the SWT methods and classes? I am calling BrailleBlasster from the
command line with java -jar brailleblaster.jar However, I've called GUI programs from the command line before, and they operate normally. Any
suggestions will be appreciated.

Thanks,
John



--
John J. Boyer; President, Chief Software Developer
Abilitiessoft, Inc.
http://www.abilitiessoft.com
Madison, Wisconsin USA
Developing software for people with disabilities




Other related posts: