How Do I get detailed printer Informations in JavaFX - javafx

The JavaFX class Printer offers the method showPrintDialog(). This dialog displays detailed data about the selected printer (type, location, comment).
I intend to display this information in a different context. Does anyone know how to get this information?

Related

Communication between multiple dialogs in Qt, using signals and slots or references

Im developing a Qt GUI application, with multiple QDialog's open at any given time.
These dialogs need to communicate and notify with each other when special data is received on a separate network thread.
Usually a dialog will hold a reference to at least one other dialog, and thus can communicate using this.
My question is whether to use this reference to call a function in a another dialog, or emit a signal and absorb that signal in a slot in another dialog? Im aware that this might be a preference - but I would still like to get some input on this.
I suggest you start by looking at Qt's Model View Programming. Based on the Model View Controller design pattern, you would be better off separating data (the model) and the view of that data.
If you follow Qt's Model View Programming, you'll find that when the model containing your data changes, the view(s) are notified and react accordingly. You shouldn't need to message from one dialog to another.

Are adapters only for ListViews?

I want to have a kind of view manager object to provide fragments created, chosen and changed at runtime for inclusion in a two-paned xml layout. Can I get this type of functionality by deriving from an adapter?

How to does WindowsRT Data-binding do type conversion without TypeConverterAttribute

In a previous question/answer I learnt how data-binding in Windows Phone does TypeConversion for string to ImageSource using the TypeConverterAttribute - see https://stackoverflow.com/a/16753488/373321
I'm now looking at the same problem in WindowsStore apps where TypeConverterAttribute doesn't exist.
If I use WinRT data-binding then clearly the data-binding layer still manages to do the correct conversion. The MSDN documentation says:
this behavior relies on underlying type conversion that processes the string as a URI, and calls the equivalent of the BitmapImage(Uri) constructor.
However, I can't see any meta-data anywhere about how it knows what conversion to do.
I'm trying to build my own data-binding implementation - so being able to mimic what WinRT does would be very useful.
Is there a queryable metadata hint somewhere which tells the Xaml data-binding what conversion to apply? Or is this string to ImageSource conversion somehow baked into the run-time, hidden from the CLR layer?
If it is hidden, is there a list anywhere of known automatic type conversions so that I could cache them in my data-binding implementation?
I discussed this question via Twitter with one of the WinRT devs (Tim Heuer)
A basic summary of this conversation was:
WinRT does not have anything like TypeConverterAttribute
A small number of WinRT controls do have a small number of internal conversions that they will apply
There is no information publicly available about which controls and conversions these are
In Windows 8 Apps, this is generally handled by creating a class that inherits from IValueConverter, and is then assigned alongside the particular data binding. As stated on the msdn site:
"Create a converter by implementing the IValueConverter interface and implementing the Convert method. That method should return an object that is of the same type as the dependency property that the binding targets, or at least a type that can be implicitly coerced or converted to the target type."
Here is the link to the full doc: http://msdn.microsoft.com/en-US/library/windows/apps/windows.ui.xaml.data.binding.converter.aspx
See the "Examples" section for further detail.
To answer your question, there is no metadata hint, you simply create your converter and then explicitly assign the converter alongside your custom data binding.

Printing byte array image to printer

I have byte array image and want to print/send it to printer through my web application.
How can I print that byte array to my local printer through web app.
Unfortunately you're limited to printing capabilities of the browser, and those capabilities are not particular fantastic. A typical approach is to utilise a client-side plugin and format your 'response' to the browser to work with that plugin.
One example is creating an Adobe PDF and passing that as your response to the client. Here's an example using a free library.

TypeError: Error #1009 - (Null reference error) With Flash

I am not an expert in flash, but I do work with AS and tweak Flash projects, though not having deep expertise in it. Currently I need to revamp a flash website done by one another guy, and the code base given to me, upon execution is throwing the following error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at NewSite_fla::MainTimeline/__setProp_ContactOutP1_ContactOut_Contents_0()
at NewSite_fla::MainTimeline/frame1()
The structure of the project is like, it has the different sections split into different movie clips. There is no single main timeline, but click actions on different areas of seperate movie clips will take them between one another. All the AS logic of event handling are written inline in FLA , no seperate Document class exists.
Preloader Movie clip is the first one getting loaded. As i understood the error is getting thrown initially itself, and it is not happening due to any Action script logic written inline, because it is throwing error even before hitting the first inline AS code.
I am not able to figure out what exactly is causing the problem, or where to resolve it. I setup the stuff online, for reference if anybody want to take a look at it, and here is the link. You need to have flash debugger turned ON in your browser, if need to see the exception getting triggered.
I really got stuck at this point. Any help will be great. I had not seen the particular solution I am looking for anywhere yet, though Error #1009 is common.
Did you set the option "Export at frame 1" for the classes in your library?
I get this error for instance:
I have a circle which is a Circle class and put it on Frame 10.
If I try to attach a eventHandler to it from frame 1, I get this error.
Set the option "Export at frame 1" for my Circle class will solve this issue for me.

Resources