choosing components in Vaadin - java

My task is to create a grid with different cars on one axis, and different dates on another one. The content of the grid is going to be different tasks that are going to be carried out by different cars on different days. Basically - its a scheduling program. There has to be a drag and drop function between a list of tasks and the grid. I've been trying to get started all day but have not come far. I really need your help me with the following:
What component should I use to create the grid? Labels for different dates with boxes that together form a grid, or should I use a specific grid function?
What component should I use to create the list of tasks? I would like to be able to add tasks to the list that I can then drag out to the grid, but it's not a requirement. Ive tried to use the Listselector because of its persuasive list-appearance, but as the name might reveal its a selector. I really cant find any method to add things to the list, or for that matter to create the drag function?
I would be exteremly thankful if you would lend me a helping hand. And please - feel free to PM me or write a comment here.

Have you seen the Vaadin Demo site? They have many widgets used in various scenarios. Click to see the source code.
Here is one that does almost exactly your case: Drag items between tree and table.
Vaadin is brilliantly designed, with consistency. Once you learn about a few widgets you will see the same patterns being used elsewhere. In particular, study the Item and Container interfaces and classes, as discussed in this chapter Collecting Items in Containers.
Read various chapters the Book of Vaadin web site. Lots of info and examples.

Related

JavaFX - Sequential Transition modify at runtime

I have been exploring the Sequential Transition from JavaFX, and it seems a perfect fit for what I need. So, I am working on a JavaFX desktop application that essentially shows some pictures, text, and plays some video and audio files. Now, since some of those items are presented sequentially, I have decided to use the sequential transition. Now, I just run into a problem that I have tried to address but it does not seem to work as expected. Let's imagine that the sequence in which those items are presented is predefined in a Map. When those items are presented to the user, he/she needs to provide an answer, and if that is correct you can think that the item can be categorized as Done. However, in some of the cases I need that the user repeats some of the items for learning purposes. And that has to be done 'on-the-fly' since I have another window in which someone else decides which items must be repeated. As you can see, this requires some modification of the sequential transition at runtime. Is there any suggestions on how to address this challenge?
Thanks,
As the documentation for SequentialTransition states:
It is not possible to change the children of a running SequentialTransition. If the children are changed for a running SequentialTransition, the animation has to be stopped and started again to pick up the new value.

Disable Materialize Framework "Responsiveness"

I am attempting to use the materialize framework. I am very much liking the features it provides but I don't really care too much about making everything "responsive" right now. I would like to make things somewhat "static", meaning when I resize the browser, everything stays the same size (and user can scroll around in a smaller window to find what they want). I plan to later work on the full "responsiveness" to support things like mobile, window resizing, etc. Below shows whats currently happening. I downloaded the whole framework so I'm free to alter the .css that comes along with it, but I'm not really a .css expert so not really sure where to begin.
Full Screen
Resized Screen - obviously cannot stay like this forever
Any help is much appreciated.
First to answer your question directly: I assume you are using the Materialize grid? Meaning you have divs with class names like "col l6"? To have non responsive elements you should not use any materialize column class names. It will then just be regular old HTML and CSS that you define. Materialize only applies its CSS to elements that use its classnames.
Now for a recommendation: This will probably break some of the features of Materialize. Or at the very least, it will look gross and you will have to add padding/margins everywhere manually. Then if you want to go back and enable mobile responsiveness, you will have to manually remove all of that. You will also have to use old fashioned CSS rules to determine you element sizing. Every element will need a height and width rule applied to it. It is a lot harder to add mobile responsive classes later. It will save you a lot of time if you just do it now. It's quite easy in Materialize once you get the hang of it.
One of the main reasons that Materialize and Bootstrap and the like are used, is to make mobile responsive websites easy. It really is an essential skill to learn for web development these days.

Using Java Swing, how could one implement a search box that has options similar to web browsers or iTunes?

Didn't know quite how to title this question, so suggested edits are welcome.
Right now, I have a fairly simple pair of JComboBoxes for searching row & column headers in a heatmap display. It's been augmented with the ability to allow wildcards. Here's what it looks like:
It works well enough, but a new requirement for the next version is to consolidate the pair of search boxes into 1 search box plus a few other enhancements. Basically, what we'd like to do is enter a search term and have the resulting dropdown have 2 sections: 1 for options and another for the matching results. The desired options would be things like this:
Search rows/columns checkboxes
song/artist/genre checkboxes (to use the iTunes analogy) or google/bing (to use the browser analogy)
Search within previous search results: like have a previous search term with an 'x' next to it to clear it. It would act like a filter.
The thing about this is, the desire to consolidate 2 search boxes to 1 is to simplify the interface, but at the same time, we want this additional functionality.
A JComboBox doesn't seem to be able to handle something like this, and my search for alternatives isn't yielding anything. I know this question is somewhat of a broad design question, perhaps not appropriate for stack exchange. I'm still fairly new to Java, so any suggestions are appreciated.
UPDATE: One of the commenters asked for something more specific and pointed out the existence of different types of iTunes searches based on context, which I'd like to disambiguate. Taking a look at how iTunes does it, I decided to try to mock up a graphic of what I was thinking I could do:
So given this specific example, I envision separating the combo box and the search options, perhaps with a JMenu revealed using a button made to look like iTunes' search options feature.
So my evolved questions are (based on the above mock-up):
Can JMenu do this or is there another type of button-initiated menu I should use?
Can menu selections trigger a re-population of the list the JComboBox provides or would that have bad side-effects?
How can I alleviate the confusion of having a drop-down on either side of the search field?

"Quick find" for an SWT Table

I have a table that displays the output from a database, this can often be up to or over 10,000 rows. I'm looking to implement a 'quick find' function that will allow the user to easily scroll to a row with the value for which they search.
The idea is for this to be very similar to Chrome or Firefox's quick find. So:
User hits 'CTRL+F'
A box pops up:
The user can then quickly skim through the table pushing / or /\ to each matching value
My question is, does such a table already exist? I have looked at NatTable and XViewer but they both seem like rather large additions for a relatively minor change.
Another library I've looked at that is close to fitting the billl is Lucene TableSearcher unfortunately this is designed for filtering rather than highlighting. However it may be an avenue worth investigating.
It's not quite the same, but JFace does have support for filtering views. You type in a text box and view contents shrink to what matches the filter. It's basically another way to present search/find functionality to the user.
You can see this in action in Eclipse Preferences (the filter text field about the navigation tree in the dialog). See org.eclipse.ui.dialogs.FilteredTree class. I don't believe there is a FilteredTable or equivalent, but underlying facilities are pretty generic, so it shouldn't take much work to put one together. Take a look at FilteredTree source and go from there.
The solution I chose wasn't as simple as I'd hoped but has a satisfactory performance.
The tables involved are virtual tables that can be very large. So on top of this upon loading the dataset we start a thread to build an index in the form of a list. Because these tables can be very large (but aren't often) we set a 50mb limit to this list and stop indexing it when we hit it. For most cases this is perfectly acceptable but for the larger tables it means that whilst it may be slower, it is considerably more stable than other options.
The 'search' is a simple SWT textbox with ModifyListener that iterates over the list, performing a 'contains' on each entry. Upon a match the row and column are calculated from the index number (0=0,0, 1=0,1 ..).
It would have been nice to have a simple 'drop in' solution for this but all of the tables on offer had too many features.
Use FilteredItemsSelectionDialog dialog box

Looking for advice on a first android application (loading data/populating data)

to start with I've gone through the entire notepad tutorial, I'm a professional game programmer who has some extra time. (though most of my time has been in C++, I did take a year or two of Java classes in college, and remember some of it).
I'm not sure the site is a good site to ask questions like this.. If someone has a Forum that might be a good place to ask these newbie questions, please feel free to point me in the direction.
I've examined a few of the samples, and think I've a grasp of what I want to do. I've a three to four project plan for some Android releases to sharpen my skills, but since this is my first project and I have never really developed for a mobile phone or the android before, I'd like to make sure I have a solid plan.
The first project is an example of the license plate game, however I want to do a few things to change it. Heck maybe when I'm done it'll become a bingo style game, with bluetooth connectivity, you never know.
The base idea is I want to offer a list of states, with checkboxes next to them. so to do this, I'll be starting with a Linear List layout similar to the note pad example, and then have a row that is only a Checkbox. I can use text and call strike through if it's been checked off. Perhaps offer an option to not show them if they are checked.
But I want the list to be generated from a set of lists. Maybe all of America's states, maybe reasonable American states (no Hawaii, no Alaska) maybe a North American list, (add in Mexico and some Canadian provinces), a European list, who knows.
I'd probably have to have a pop up window that lists all of the lists I suppose using a radiogroup of some sort.
So then as far as the data, after weighing options I think best solution is to make a database with two fields, "checked" and "name".
I figure I can use the menu for most of the user interaction (aside from clicking on stuff we want to check off) with maybe a few context menu items, I understand how to make all of those already so I should be good.
The question I have is what is the best way to populate the lists? Should I create raw data, and have different files for all the lists? Or is there some other way to do this? I've seen this done on the searchable dictionary, but I'd like to hear what people who have actually generated the data like this before.
In addition is there an easy way to look at the sql database these applications create, or do you have to run searches on them and output the data?
Finally any other suggestion or advice? I definitely want to try to get something like this on the market so I can see the full life cycle and see if anyone actually likes it. (luckily there's not a plethora of them already) but I also want a few people to look over my code if they're willing when I'm done to make sure I've done this right or at least not missing any basic mistakes.
Thank you for your time,
Frank
As far as check boxes, you can design your list item layout to have a checkbox in it. You should make some sort of object that will hold all of the data for each list item, including the status of their checkbox (something like isChecked). Instead of storing a list of String objects containing the names of states, you should have a list of State objects. then, say you wanted to take some action on every checked item, you can easily iterate through the list you gave to the ListAdapter and see which ones are selected.
Was this helpful?
You can stick to C++ if thats your thing (there are some limitations, there are some benefits) , please read this primer for details.
For data folks are going to steer you towards SQLite since is available OOTB with Android.

Categories

Resources