Rotate node for displaying landscape/portrait on handheld device

The javafx application I am developing will eventually be running on a handheld device with 800x480 resolution. The application will typically be running in portrait mode, but for some features (e.g. displaying charts and tables), it will need to switch to landscape mode to better display the data.
My question is, is there a straight forward way to operate with nodes that are rotated by multiples of 90 degrees?
I can rotate the table by calling setRotate(), although this introduces several new issues:
To resize column widths when rotated, the user has to drag the column dividers left to right (orthogonal to the row of headers), The table still expands its width/height to the size of its parent, although this doesn't work as well when rotated -90 degrees (or other multiples of 90).
The other constraint is that the chart content is contained in the center of a BorderPane, where the top and bottom of the BorderPane contain toolbars, which prevents rotating the entire scene.
Here is my SSCCE; please correct me if there are any problems with the code below.
import javafx.application.Application;
    import javafx.event.ActionEvent;
    import javafx.event.EventHandler;
    import javafx.scene.Scene;
    import javafx.scene.control.Button;
    import javafx.scene.control.TableColumn;
    import javafx.scene.control.TableView;
    import javafx.scene.layout.BorderPane;
    import javafx.scene.layout.Pane;
    import javafx.scene.layout.VBox;
    import javafx.stage.Stage;
    public class TablePanelTrial extends Application {
        BorderPane root = new BorderPane();
        private boolean isRotated=false;
        public static void main(String[] args) {
            launch(args);
        @Override
        public void start(final Stage primaryStage) {
            primaryStage.setTitle("Table Panel Trial");
            final TablePanel tp = new TablePanel();
            Button btnRotate = new Button("Rotate");
            btnRotate.setOnAction(new EventHandler() {
                @Override
                public void handle(ActionEvent event) {
                    double r = -90;       
                    if(isRotated){
                        r=0;
                        isRotated = !isRotated;
                    else{
                        r=-90;
                        tp.tv.setMinHeight(200);
                        isRotated = !isRotated;
                    tp.rotate(r);
            root.setTop(btnRotate);
            root.setCenter(tp.getVB());
            primaryStage.setScene(new Scene(root, 480, 800));
            primaryStage.show();
        class TablePanel{
            private VBox vbox = new VBox();
            private TableView tv = new TableView();
            private String[] labelVal = {"Column 1", "Element", "Difference", "File Name", "Report Number"};
            public TablePanel(){
                TableColumn column1 = new TableColumn(labelVal[0]);
                TableColumn column2 = new TableColumn(labelVal[1]);
                TableColumn column3 = new TableColumn(labelVal[2]);
                TableColumn column4 = new TableColumn(labelVal[3]);
                TableColumn column5 = new TableColumn(labelVal[4]);
                tv.getColumns().addAll(column1, column2, column3, column4,column5);
                vbox.getChildren().add(tv);
                tv.setPrefHeight(2000);
            public Pane getVB(){
                return vbox;
            public void rotate(double r){
                vbox.setRotate(r);
    }

It will be on an Colibri Tegra ARM board running linux. The application will have a header and footer, with the rotated content taking up the center of a BorderPane, so it might be possible to flip the stage size and somehow then rotate the content in the BorderPane. However, I have not yet found a suitable method to handle the rotating part of the problem. Any ideas?

Similar Messages

  • Mysterious but clever facility on Macbook rotating photos for display.

    I have a question that has puzzled me for days and I can't find out how or why the Macbook does this.
    I took a photo on my digi camera in "Portrait" orientation or mode in other words I turned the camera sideways on to take a photo of a tall building. When I transferred the jpg from camera card to Macbook desktop the photo thumbnail on the desktop was mysteriously rotated by stealth purely for viewing as a thumbnail on the screen. More confusion followed! When I transfer the same photo to my PC (sorry to use a two letter word!) the photo on the desktop is still in "landscape" mode and opening it in any PC software displays it in landscape sideways on so I have to rotate it and save it in new orientation.
    I tried opening the picture on the Macbook using Preview and it appears there, turned into correct orientation (Portrait) but the picture hasn't been rotated by me. Also when I attach the said photo to an email it dumps the picture on its side (un-rotated) so is impossible to view properly by the recipient of the mail unless they rotate the picture in software external to their email client. Or perhaps turn their monitor on its side, or get a crick in their neck
    On the Macbook opening the picture using a web-browser it appears the way it is in reality ie on its side and needs turning through 90 deg. But Preview and iPhoto both turn it the right way up for viewing. So the picture is artificially "righted" by desktop thumbnail view; by iPhoto viewing; by Preview viewing, but left in its original orientation for email and webpage viewing.
    How does the Macbook know that this is a photo that has arrived on its side and needs rotating to view it, but then leaves the actual physical rotation to us for doing in an external program?
    This secret facility did slightly wrong-foot me as I forgot to rotate the picture and added it to an email both by Insert facility and Attach facility and in both instances the photo sat in the email on its side.
    My bible "Switching to the mac Leopard Edition" says nothing about this trick of Macs to display unrotated photos in correct view. Can anyone please throw any light on this concept for me?
    Thanks in advance
    Plado

    Well the plot thickens a bit here. I managed to get a photo with rotational information built-in, to appear in Thunderbird email the right way up by Rotating Anti Clockwise 3 times. Then when I added the picture to email it ended up the right way up.
    So the next day I tried another experiment and I switched off the AUTO-ROTATE setting in the Canon Camera and took a picture in Portrait orientation (turning the camera on its side as usual) I then took an identical photo with Auto-Rotate switched back on. I imported both pictures to the Macbook. I saw that the auto rotate "on" setting picture appeared on my macbook desktop rotated the right way for viewing. The one with auto-rotate switched off appeared on desktop on its side.
    Now I went to add both pictures to Thunderbird email by Insert as usual and for some inexplicable reason the odd behaviour decided to cure itself and the auto-rotate photo appeared in the email the right way up instead of on its side, and the auto-rotate switched off photo appeared in the email on its side.
    I sent the email to someone who verified that picture one was the right way up, and picture 2 was on its side. So this sounds to me like it's a stupid phenomenon of Thunderbird mail as installed on a mac. There can be no other reason why it behaves one way yesterday and the opposite effect the next day.
    So I think my problem is solved now. But I bet the peculiar behaviour returns as this afternoon Thunderbird stopped displaying any cursor when clicking in the text of what I was writing. Something weird going on with that. Exasperating!
    Plado

  • Pictures not correctly displayed - landscape -  portrait

    I use picasa on my pc and orient the pictures with it ( landscape or portrait) but when I view them on apple tv the pictures are not oriented as I have them in picasa. Any help with this is much appreciated.

    Use another photo editing application to rotate your photos.

  • E4x accessing of node for display in datagridcolumn

    I'm creating my own DataGrid using AS and am not sure how to
    access the "name" of the returned XML via e4x to be used by the
    dataField property of my DataGridColumn. Below is the xml I would
    like displayed:
    <name xmlns="
    http://chapters.books.carraige.com"
    xmlns:ns3="
    http://chapters.books.carraige.com"
    xmlns:ns2="
    http://item.books.carraige.com"
    xmlns:ns1="
    http://package.books.carraige.com"
    xmlns:xsd="
    http://www.w3.org/2001/XMLSchema"
    xmlns:soap="
    http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="
    http://www.w3.org/2001/XMLSchema-instance">Raging
    Waters</name>
    <name xmlns="
    http://chapters.books.carraige.com"
    xmlns:ns3="
    http://chapters.books.carraige.com"
    xmlns:ns2="
    http://item.books.carraige.com"
    xmlns:ns1="
    http://package.books.carraige.com"
    xmlns:xsd="
    http://www.w3.org/2001/XMLSchema"
    xmlns:soap="
    http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="
    http://www.w3.org/2001/XMLSchema-instance">Bonfire
    of the Vanities</name>
    <name xmlns="
    http://chapters.books.carraige.com"
    xmlns:ns3="
    http://chapters.books.carraige.com"
    xmlns:ns2="
    http://item.books.carraige.com"
    xmlns:ns1="
    http://package.books.carraige.com"
    xmlns:xsd="
    http://www.w3.org/2001/XMLSchema"
    xmlns:soap="
    http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="
    http://www.w3.org/2001/XMLSchema-instance">Waking
    the Dead</name>
    Below is the e4x code that retrieves this:
    soap.createBooks.lastResult.*::createBooksResult.*::packs.*::PackWS.*::items.*::ItemWS.*:: chapters.*::ChapterWS.*::name
    Now i set my dataProvider property of my datagrid equal to
    the above e4x path access. This produces the correct number of
    records. However, I don't know what I need to put in for my
    dataGridColumn's dataField property in order to access the actual
    names. I've tried
    dataGridColumn.dataField = "name", but I get nothing. Does
    anyone know how to access the actual name value from the returned
    xml above for the dataField property? Thanks in advance!
    -los

    Hi Santosh,
    here is code below to filter the activities. write this before setting the collection.
      DATA: lr_entity             TYPE REF TO cl_crm_bol_entity,
                lr_col_all  TYPE REF TO if_bol_bo_col.
    lr_col_all = lv_collection->get_copy( ).
      lr_entity ?= lr_col_all->get_first( ).
      WHILE lr_entity IS BOUND.
    write the code to check the open activities and if criteria is met clear from collection as below
    lv_status = lr_entity->get_property( iv_attr_name = 'STATUS' ).
       IF lv_status = check for open status.
          lv_collection->remove( iv_bo = lr_entity ).
       endif.
          lr_entity ?= lr_col_all->get_next( ).
      ENDWHILE.
    me->set_collection( lv_collection ).
    Thanks
    sudhir grover

  • Cant install driver for display adapter (pavilon dv3)

    Hi! i cant find and install driver for display adapter. i see on device manager that without "ATI radeon 5400 seri"
    someone help me! thanks
    This question was solved.
    View Solution.

    Hi QuanTrinh
    What driver are you installing? Is it this AMD High-Definition Graphics Driver or some from the AMD website?
    Please click “Accept as Solution ” if you feel my post solved your issue.
    Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!
    Thank you,
    BHK6
    I work on behalf of HP

  • CRM installtion on handheld devices

    Hi All,
    I am working on CRM sales for mobiles and very new to it.Can anybody tell me about the prerequisites for the CRM installation on handheld devices. Do I need any front end components specifically for CRM? If it is so where I can get them?

    Hi Saptak,
    Perhaps you can try the following path to reach the MSA HH download:
    http://service.sap.com/download In the navigation tree on the left, select Download--> Installations and Upgrades --> Entry by Application Group. The select "SAP Solutions for Mobile Business" link and click "SAP MSA for HH with CRM" for the MSA HH download page.
    If you are unable to see the information on this page, you should contact your SAP Account Executive for details on how you can obtain access to this download.
    There is no demo/trial version of MSA HH available for download, in case you were wondering.
    Regards,
    Ted

  • I cannot find information to help me change the orientation of a video filmed in portrait format but only able to be played back lying on its side  (landscape) instead of upright. All the rotation buttons for iPhoto are not 'engaged' when it is in video .

    I cannot find information to help me change the orientation of a video filmed in portrait format but it can only able to be played back lying on its side  (landscape) instead of upright. All the rotation buttons for iPhoto are not 'engaged' when it is in video .

    Thanks OT,
    I tried the Export function but it would not allow me to choose the option of exporting to iMovie. I think you are right about needing Quicktime Pro. I opened iMovie and imported the clip from iPhoto and with some searching found the 'cropping, rotation' mechanism. So I now have a copy in the correct orientation. I plan to import/export it back to iPhoto because I want to have a copy on my iPhone to show people and I wanted to have it available as part of a slideshow I am making in iPhoto of my recent overseas trip. It is a pain that there is no simple orientating tool for the movie clips downloaded to iPhoto with the photos from the one camera.

  • HT3382 With a MacbookAir (mid-2012) using a mini DisplayPort to VGA adapter plugged into the Thunderbolt port, can you configure the external monitor to FULLY display in portrait mode yet keep the built-in display in landscape mode?

    With an 11"-inch Macbook Air (mid-2012) using a mini DisplayPort-to-VGA adapter plugged into the Thunderbolt port:
    Can you configure an extended desktop with an external monitor (20") displaying full portrait mode (1200 x 1600 resolution) and keep the built-in display in landscape?
    I'd like to see something like
    External monitor / Built-in display

    Yes, I can't see why not.
    Just give it a try and report back if you have a problem.

  • Logic for displaying nested nodes.

    helo all
    i have to display a report in a heirarchical tree structure . I am able to display the report in heirarchical format .
    The following is my requirement . I'm able to do it for 2 nodes . but how to build the nodes for the below requirement .
    Step 1 : Once User enters DB, Go to CHVW  with No Receipt Indicator as Space and CHARG as DB # Entered on screen(Parent Node)
    Step2: Check the Movement indicator if it is u2018Bu2019 then itu2019s a Raw material No further Drill Down (Last Node), If It is u2018Fu2019 then Go to Step 3.
    Step 3: Get all the Unique DB # and Corresponding Orders, Display only DB# on Output (Child Nodes)
    OUTPUT - ALV TREE STRUCTURE
    If User Clicks on any DB# (Child Node):
          Then DB# Selected Will Become a Parent Node, Repeat the Same Process from 1 to 3.
    Table: CHVW                                                                                DB#  Order   DB#  Order
    Tree  
    DB1
    -      DB1.1
       -     DB1.1.1
       -     DB1.1.2
       -     DB1.1.3
                -   DB1.1.3.1                               -
     DB # of Raw material No further drill Down
                      -  Material Document          -
     Display Material Doc #
        -      DB1.2
                      -      DB1.3
                             -  DB1.3.1
                            -   DB1.3.2
    can anone give me some clue..

    Yea Sandra , You are right .
    let me explain my requirement clearly .
    first of all i need to use only table CHVW for my requirement .
    the user enters the batch number in the selection screen. For that batch number, i have fetch the production order number and batch number .this forms the first node .
    For the second node , i have to again select from Chvw table using the production order numbers obtained from the first select statement . the batch numbers obtained from this select query will form the second nodes. IF the movement type indicator is B ,then these is the last node
    otherwise we have to repeat above procedure untill we movement type indicator for a particular batch number is 'B'.
    i'e for each of the batch numbers in the second nodes, i have to again get the production orders and for that production orders i have to fetch the batch numbers again .these will form the 3rd node .
    if at this step the movemtn type indicator is 'B' ths is the last node. other wise the same step should be repeated.
    could u plz give me some clue ....

  • Automatica​lly display number when the mouse attach approach node for chart ?

    Hi all,
    can automatically display number when the mouse attach approach node for chart ?
    For detail ,see attach file
    Thanks in advance !
    Attachments:
    chart display.JPG ‏70 KB

    Charts don't have cursors and they also don't have the "plot images" options, so your tools are limited.
    Of course you can simulate a chart using a graph by keeping your own history and display it on a graph. Use cursor move events to trigger the calculation of the distances from the new cursor position to all points on the graph and pick the one with the shortest distance to the cursor. Now you can get the annotation tools to label the point, or get its x and y value and write the info using picture tools with the "plot images" property.
    LabVIEW Champion . Do more with less code and in less time .

  • HT1947 Remote for ipad landscape orientation not working in ios 7

    Remote for ipad landscape orientation not working in ios 7

    See this thread: remote app rotation locked in portrait orientation after iOS 7 upgrade
    It is a discussion only - no helpful hints.  Appears to be a bug for sure.

  • Rotating entire JFrame to simulate portrait mode

    Hi
    I need to rotate the entire jframe into portrait mode.
    I cannot use the graphics chip, or linux graphics device manger to change the rotation CW 90 degress - due to hardware design and limitation.
    So basically, I have to render the graphics myself, quite easily done with fllowing code at the the top level panel.
    protected void paintComponent(Graphics g)
    // center of rotation is center of the panel
    Graphics2D g2d =(Graphics2D)g;
    int xRot = this.getWidth() / 2;
    int yRot = this.getHeight() / 2;
    g2d.rotate(Math.toRadians(-90), xRot, yRot);
    super.paintComponent(g);
    This does the job nicely, however the screen is still using landscape co-ordinates, and hence when clicking on the swing components they are in the pre-rotation position.
    I have looked and cannot find, is there a simple way to switch a jframe into portrait mode. If not, is there a simple way to intercept the screen coordinates and translate the mouse coordinates to the appropriate JComponent?
    thanks in advance
    Steve

    import java.awt.*;
    import java.awt.event.*;
    import java.awt.font.*;
    import java.awt.geom.*;
    import java.util.ArrayList;
    import java.util.List;
    import javax.swing.*;
    public class TransformPoints extends JPanel {
        List<PointStore> list = new ArrayList<PointStore>();
        AffineTransform at = new AffineTransform();
        String s = "Hello World";
        protected void paintComponent(Graphics g) {
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            Color color = g2.getColor();
            drawPoints(g2);
            g2.setPaint(color);
            FontRenderContext frc = g2.getFontRenderContext();
            Font font = g2.getFont().deriveFont(36f);
            Graphics2D copy = (Graphics2D)g.create();
            copy.setFont(font);
            LineMetrics lm = font.getLineMetrics(s, frc);
            float height = lm.getAscent() + lm.getDescent();
            float width = (float)font.getStringBounds(s, frc).getWidth();
            int w = getWidth();
            int h = getHeight();
            System.out.printf("w: %d  h: %d%n", w, h);
            float x = (w - width)/2;
            float y = (h - height)/2 + lm.getAscent();
    //        copy.rotate(-Math.PI/2, w/2, h/2);
            at.setToRotation(-Math.PI/2, w/2, h/2);
            copy.transform(at);
            copy.drawString(s, x, y);
            // draw some reference lines
            copy.setPaint(Color.pink);
            copy.draw(getBounds());
            copy.drawLine(w/2, 0, w/2, h);
            copy.drawLine(0, h/2, w, h/2);
            copy.dispose();
        private void drawPoints(Graphics2D g2) {
            for(int i = 0; i < list.size(); i++) {
                PointStore store = list.get(i);
                Point p = store.loc;
                g2.setPaint(Color.blue);
                g2.drawString(store.viewLoc, p.x+3, p.y);
                g2.setPaint(Color.red);
                g2.drawString(store.xformLoc, p.x+3, p.y+12);
                g2.fill(new Ellipse2D.Double(p.x-1.5, p.y-1.5, 4, 4));
        public static void main(String[] args) {
            TransformPoints test = new TransformPoints();
            JFrame f = new JFrame("click me");
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.add(test);
            f.setSize(500,300);
            f.setLocation(100,100);
            f.setVisible(true);
            test.addMouseListener(test.ml);
        private MouseListener ml = new MouseAdapter() {
            public void mousePressed(MouseEvent e) {
                Point p = e.getPoint();
                String viewStr = String.format("[%d, %d]", p.x, p.y);
                Point2D.Double xp = getInvertedPoint(p);
                String xfStr = String.format("[%.1f, %.1f]", xp.x, xp.y);
                list.add(new PointStore(p, viewStr, xfStr));
                repaint();
            private Point2D.Double getInvertedPoint(Point2D p) {
                Point2D.Double xp = new Point2D.Double();
                if(at.getDeterminant() != 0) {
                    try {
                        at.inverseTransform(p, xp);
                    } catch(NoninvertibleTransformException  e) {
                        System.out.println("invert error: " + e.getMessage());
                return xp;
    class PointStore {
        Point loc;
        String viewLoc;
        String xformLoc;
        public PointStore(Point p, String view, String xform) {
            loc = p;
            viewLoc = view;
            xformLoc = xform;
    }

  • After current update the rotate lock locks in landscape mode..

    Ive tried restarted my phone and such and doesnt seem to help. After the current update 10.3.1.1581. When i turn my rotation lock on it rotates my view in the hub or anything to landscape and locks it there instead of portrait. Quite annoying.

    Turn rotation lock off, while not ideal I found that at least when the phone is held in portrait orientation the apps display in portrait, there is a knowledge base article about this, sorry I don't have the link to hand. But they are aware of the issue but no fix as yet.
    Edit: here is the link http://www.blackberry.com/btsc/KB36744

  • Rotate the computer display by 90 degrees

    Hi all,
    Does anybody know how to rotate the computer display by 90 degrees programmatically in Labview?
    I searched on the internet and got an idea to use user32.dll to do that.
    They used EnumDisplaySettings() and ChangeDisplaySettings() to do that.
    However I'm not quite familiar with C.
    Looking for help to do it with Call Library Function Node.
    Thanks.
    (windows 7 64bit, labview 32bit)

    Here's an example of what I was thinking.  Of course with an array of picture controls that means all columns would need to be the same width.  Of course if you don't have horizontal scrolling you could get away with fixed images.
    Now that I think about it what is wrong with just some string comments on the front panel of the column text doesn't change, and no horizontal scrolling.?
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.
    Attachments:
    Example Vertical Column text.vi ‏12 KB

  • Switching laptop display to portrait mode the mouse reorients itself successfully. THetouchpa

    When switching the Pavilion DM1Z -2100 display to portrait mode the mouse reorients itself but the touchpad does not.  How can I get the touchpad to work correctly in Display Portrait Mode?

    I do though hesitate to rotate the whole body of the machine. Functioning vertically may not be the best of things to do. At least back 10 years ago, and I don't know if it is true now, shifting the drive from the position it was formatted in relative to gravity to a different one for use without reformatting it can shorten the length of the hard drive. This was the case with the drives on some PowerMac 6500s which were formatted vertically and placed horizontally elsewhere.
    Whether or not you can do that with notebook drives regularly, remains to be seen. I'd say it would be better to get an external display that supports the rotation.

Maybe you are looking for

  • HP Officejet 6600 Fax Problems

    I have an HP Officejet 6600 and cannot fax to local numbers or some out of state numbers.  I can fax to HP out of state and towns other than my own. Is this due to it being sent digitally?  Can the machine be set to fax analog? I have ATT-Uverse for

  • Idoc segment release

    Hi, I wish to change one of the field's length in an idoc segment. It doesn't allow me to change it as the version is already released. However, I cannot  cancel the release too, as the released version belongs to an earlier version of SAP (4.7). The

  • Get web player to work when flash is click to play

    The latest firefox, and my chrome at work have now made flash "click to play" due to the numerous security issues with flash. However, Spotify web player requires flash to run. When flash is set to "click to play" the web player complains that flash

  • Include file is not found by MDS

    In my home.jspx file, I have <jsp:directive.include file="/common/includes/layout.jspf"/> which essentially to include layout file and the path is relative to context root. I got the following error: INFO: Using the ProviderURI /mdssys/ViewController

  • Unable to connect JMS server

    Hi , We are running weblogic 6.1 and using the MDB example provided in the documentaion. We have added some logic according to our business rule in the onMessage() function of the bean. The problem is JMS connection is getting timed out after some ti