I need your help with my application.
I'm writing a program that displays big images in tiles, using the SWT MapWidget (http://mappanel.sourceforge.net/swt/).
The user has the ability to place markers on the map, when he pressed the mouse for a couple seconds. Additionally, I also need a little ZoomBox next to the cursor that shows the area around the cursor, so that the user has better precision when placing a marker. This ZoomBox is to be displayed while the user keeps the mouse pressed. Placing the markers ia already working fine.
I have problems with implementing the ZoomBox, specifically displaying it. I found a post that does just what I need (Zoom box for area around mouse location on screen). The problem is, this post is for Swing and not for SWT.
I have already built a SWT_AWT-Bridge, so I have the ZoomPanel already in my shell. What I need is the functionality of displaying it on top of the MapWidget, while the user keeps the mouse pressed.
I figured, I need to use a StackLayout, but I don't know how.
EDIT
To clarify, my question is, how can I display the composite containing my ZoomBox on top of my image, while the user keeps the mouse pressed?
Related
I want to generate mouse click events for a Java application. I am aware that there is java.awt.Robot, which would allow me to do this. However, I would like that the generated mouse events do not actually affect the "cursor". That is, I would like to be able to minimize the window of the Java program and do other things with the mouse cursor, while mouse events are still generated for that program. How could I do that?
Edit: Furthermore, I cannot be assumed that there is a number of buttons that I need to interact with. Rather I'd like to generate mouse click events as if I had clicked at a certain position within the window.
I don't know exaclty how it is called, but I got a screenshot:
Basically, in this case, I press a button and this window from "FC Barcelona" pops up, occupying about 3/4 of the screen. After it is opened I can drag it up and down. If I drag it up, it occupies the whole screen, if I drag it down, it disappear.
How can I use this tool or how it is called in android?
What you want is a BottomSheet. You can find an example on how to do it there at the Design Support Library: Bottom Sheets section.
http://android-developers.blogspot.de/2016/02/android-support-library-232.html
I'm trying to create some drawing functionality, effectively very similar to MSPaint. I want to make a TextBox tool, such that I can draw a textbox on my canvas and have a user type in it like a real textbox. Once the user clicks off of the textbox or presses escape, then I would "stroke" the text to the GraphicsContext.
I'm not sure how to do this. My current attempt has me using StackPane to stack two canvases on top of each other. I let the user "draw" a textbox with the mouse, and then I create a textbox programmatically which I am trying to pass the keyevents into. Then when the user clicks off, I write textbox.getText() to the GraphicsContext. This has not been very successful. Specifically, I'm not sure how to handle special keys like BACKSPACE and DELETE and letting the user click to place the cursor.
I'm looking for advice on a better approach.
I have to develop a touch screen application based on swing for the GUI part.
The application will have to be displayed on different screen, one 15" 4/3 screen and one 20".
What kind of layout stategy should i go for, to keep the same proportion in my components from one screen to another ?
The application will have a kind of status bar at the top displaying some information coming from a server, a menu bar at the bottom, the main central part of the application will display graphs, and on the right an area that will display the same information as the graphs, but in digital format. Buttons from the menu bar and labels in display/status bar have to be quite big as the users that will play with the screen may wear gloves...
Thanks you for help.
any specific layout manager is not gonna do the trick....Handling the window size is not a problem as that can be taken care of (use ToolKit for that). Only problem is that u gotta make sure that, the component sizes are not fixed, cos when screen size changes that gotta change as well. This is a peculiar problem, lot of trail and testing may be required.
I'm having issues while coding for my Evo. While touching the screen, the Evo interprets me touching the buttons as another press on the screen instead of a onKeyDown, onBackPressed, etc. (It actually sets the MotionEvent pointer count to 2, and I can get the co-ords that I'm touching that are off the main screen, for example, 830*190 when touching the back button.)
Short of coding in the locations of the buttons (which would be different for every phone with capacitive buttons, if they all have the same issue), is there any way to get around this? Does anyone else have this issue with a different capacitive buttoned device?
On the Evo, the area where the buttons are uses the same capacitive touch sensor as the screen. You can test this by loading up a webpage and scrolling until your finger is in the buttons region. Instead of pressing those buttons, you just continue to scroll around on the webpage, because as far as the phone is concerned you're still touching the "screen".