Make Master Page (Screen) on JavaFX - javafx-8

I have some trouble when I arrange my javafx layout. I use BorderPane. Top and Left area are for static view (page). I placed MenuBar on the Top, and some Buttons on the Left, like in the picture. And, when I click a Button, the content will be opened in the center. Every Button has different content and layout. "Money Box" button will have TabPane for its content, and I have created it using SceneBuilder. "Cafe" button will have Table for its content, and I have created it using SceneBuilder. What strategy, or what do I have to do for solving my problem here.
[img]http://i.imgur.com/fG6a0kg.png[/img]

I am not 100% sure what exactly you are looking for, and based on your description there are many ways to accomplish what you need. I have a similar behavior that we use different FXMLs for each selected layout and load those and remove those from the scene.
private void openMiddleNode(String view) {}
try {
FXMLLoader loader = new FXMLLoader();
Parent node = loader.load(getClass().getClassLoader().getResource(view).openStream());
//If your middle section has it's own controller (likely an instance variable, if it needs to respond to events from the parent controller)
MyController controller = loader.getController();
controller.anyCustomSetup();
//Assumes that this middlePane is defined in the FXML and initialized above
middlePane.getChildren().setAll(node);
} catch (IOException ie){
if(logger.isErrorEnabled()){
logger.error("An exception has been thrown: " + ie);
}
}
}

Related

Get specific Item of NSToolbar

I want to have a NSToolbar in my macOS-App. I have created a Toolbar in the Window of my storyboard and connected this with a swift class called MainToolbar.
The source text of this class is the following (at this moment):
import Cocoa
class MainToolbar: NSToolbar, NSToolbarDelegate {
override init(identifier: String) {
super.init(identifier: identifier)
}
}
Now, I want to change the title of the Colors-Element and add a share button as two examples.
The Colors-Element has the identifier "NSToolbarShowColorsItem" in the storyboard.
I know, that there is the possibility of getting the items with "self.items", but there is now way of adding elements because it is immutable. And I also cannot find the way of getting elements with the identifier.
In order to do this you have to go to the storyboard and click on the toolbar.
The toolbar will open up and show two sections. The top section is the available buttons and the bottom section is the default buttons for the application.
I don't think it is wise to actually change the standard buttons, i.e. change the meaning of Colors. It is better to add a new NSToolbarItem to the top section. After you added it, you can double click on the title to give it a title and you can set the image by providing an image name in the Attribute Inspector.
Next you drag the new button from the top section to the bottom section.
Actions should be set from the top section and not from the bottom section.

animate a child view of listview in position 1

I created a code that animates all the children of the ListView except the position 1.
if I reduce the application with the "home" button and I come back on, the animation of the view at position 1 is not launched. So if I press a "Preferences" button in the action bar which launches another activity, and then I press the "back" button, the animation is started.
Also, if I click on the item, the animation is started.
Finally, if I scroll to hide the view at position 1 and I scroll to draw again, the animation is started.
I do not think posting the code is useful because it works for all other views.
I tried to use the "convertView" of the Adapter, I also try to redraw the whole, it does not work.
I hope that the solution lies in an option to enable it in the ListView. Thank you.
I have the same problem. I just noticed that the view at position 1 is redrawn (in the getView method of the adapter) more times than others view.
Your listview layout_width and layout_height attr. are match_parent? If listview layout attrs are wrap_content, it called getView every width or height changing.
Optimize adapter code but your code want position variable shouldn't use. Because very dangerous row cached.
if( convertView == null){
// inflate
...
convertView.setTag(holder);
}else{
holder = ((Holder)convertView.getTag());
}
...
Other options very simply but not fast and memory friendly
// inflate convertView
convertView = inflater.inflate(, );
// than use convertViews child view

eclipse e4 (Juno) : Not able to hide view Part minimize/maximize buttons

within part stack, i have part views. , and each view has minimize/maximize buttons,
Is there is any way i can hide minimize/maximize buttons for some particular view part ?
This is a bug in e4:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=394231
There are two different ways to work around this:
Remove this dependency org.eclipse.e4.ui.workbench.addons.swt
Use this CSS-snippet:
.MPartStack {
swt-maximize-visible: false;
swt-minimize-visible: false;
}
But there is another bug if you apply rule as below:
.MPartStack {
swt-maximize-visible: true;
swt-minimize-visible: false;
}
Initially "Minimize" button is hidden.
If you maximize a part stack, now "Minimize" button is visible and you can really minimize the part stack.
MinMaxAddon#setCTFButtons(..) does not respect what css rule said, which always reveal the "Minimize" button for maximized part stack.

how to hide eclipse rcp viewpart borders

Within the View RCP , I'm trying to figure out how to modify or hide the standard 1-pixel black border around each view, or if it's even possible. Anybody know how?
The view is created using standard rcp viewpart extension
Any help or pointers will be helpful
Thanks
You can remove the border around the views if you modifiy the view's parent layout in ViewPart#createPartControl in one of your views like this:
public void createPartControl(Composite parent) {
Composite view_parent = parent.getParent().getParent().getParent();
StackLayout stack_layout = (StackLayout) view_parent.getLayout();
stack_layout.marginHeight = -1;
stack_layout.marginWidth = -1;
// Your code
}
After that you should set the views attributes:
standalone to true
showTitle to false
Unfortunately the border of the "resizer" between the views is still there. If I find a solution for that I will update my answer.
Note: If you have just one view, everything looks nice.

iPhone SDK allow touches to affect multiple views

I have a main view that has has two buttons on it that control methods to display the next image and display the previous image. In this case the 'Image' is a class that inherits from UIImageView and has multiple pictures on it that you can interact with, and I call this class a 'Pane'. The pane itself handles all the user interaction itself while the main view controls the display of next and previous panes with the buttons. Here is my dilemma, because the pane fully covers the main view it wont allow for the user to tap the buttons on the main view! So once a pane pops up you cannot change it via the buttons! Is there a way to allow touches through transparent parts of a view, or if not how in the world do I achieve this?!
I cannot pass touchesBegan or any of those methods from the pane to the superview because all of the button touch methods are created in the xib file.
I cannot insert the pane under the control panel because then you wouldn't be able to interact with the pane. And as far as I know theres no way to pass touch events to every single pane within the paneHoldingArray that belongs to the main view
I cannot add the command buttons inside of the pane because I want to be able to replace the command button's image with a thumbprint render of the next/previous pane.
I've been stuck on this for a very long time, please somebody help me out with a fix action or a new way to re-engineer the code so that it will work!
If you want the buttons to capture events, then layer them above the pane. You say you cannot put the control panel above the pane, so break the buttons out into another view that you can put above the pane. If you want the buttons to appear under other views, then make some completely transparent custom buttons to handle you actions that you can layer on top.
I don't know what you mean by the button touch methods are created in the xib file, but in general you cannot effectively pass touch events around. You must organize the view hierarchy so that the views you want to receive events are logically on top. However, nothing says that the views on top have to be opaque or even visible.