How to position things based on the size of Text widget

e.g. If I want to place the center of the baseline of a simple string over a certain point, what would I do?
Text t = new Text("Hello");
t.setTextOrigin(VPos.BASELINE);
I was thinking of doing something like:
t.setTranslateX(-width/2.0);
But I can't get the width. Text does not have a "width" property!
How do I know what X coordinate corresponds to the center of the Text node?
Font doesn't have any methods for computing bounds of characters or strings
EDIT....
As usually I think I've found a way a couple seconds after posting...
text.prefWidth(-1) appears to return a reasonable value.
EDIT #2...
Looked reasonable but isn't right. So far I've had to wrap the Text in a Pane just so I can bind to the width of the Pane. That seems like jumping through too many hoops.
Edited by: swpalmer on Dec 19, 2011 11:41 AM

Well, you can not create dependencies like this, but you could use nested master pages. You would still need 30 master pages for 30 chapters, in order to place the chapter number in different positions, but you
would only need one or two main master pages for the rest of master page content. That would make it at least easier to change something on all master pages at once.

Similar Messages

  • I Cannot get my organizer to work for Elements 13. "A problem caused the program to stop working correctly. Windows will close the program......" is the error I get. I've uninstalled and reinstalled the program and tried various other things based on the

    I Cannot get my organizer to work for Elements 13. "A problem caused the program to stop working correctly. Windows will close the program......" is the error I get. I've uninstalled and reinstalled the program and tried various other things based on the MANY other complaints with this same issue and nothing is working. How can this problem be corrected?

    Hi,
    Which operating system are you running on?
    Are you upgrading from a previous version of Photoshop elements or is this your first?
    Are you trying to load the organizer or the editor or do both fail?
    Brian

  • How can I check and change the size of photo or doc in iPhone or any other app

    How can I check and change the size of photo or doc in iPhone or any other app

    You would need software form a third party to have this option.  The free software that comes with the 8600 doesn't have an option for that. Vuescan is the only software I could find that says it works with your pritner and has a descreen option.  You have to purchase it, but it will give you more advanced options than the software that came with the printer.
    -------------How do I give Kudos? | How do I mark a post as Solved? --------------------------------------------------------

  • How to increase the size of text boxes in FCPX without stretching the text inside?

    How to increase the size of text boxes in FCPX without stretching the text inside?

    There are two basic Title formats — I should say Layouts — available:  Text (plain) and Paragraph.  (The plain text version usually does not appear with the blue dot controls — those generally appear for the paragraph type control.)
    If the Title is using a Paragraph layout, it's like having a mini version of Text Edit available inside FCPX. You can tell when you click on the text (when the title is selected) -- a rectangle will appear around the text like so:
    double clicking on the text will give you the bounds controls which you can use to redefine the text area without distorting the text. Once selected, notice the button that appears in the top right corner of the canvas:
    Pressing that will activate the ruler. You can right click on the ruler and add Tab Stops (left, right, center and decimal.)
    So if the title uses paragraph formatting, you can create a very WYSIWYG type of display text (use the Text inspector to alter text selections within the paragraph bounds.)

  • How to set the size of JTextPane according to the size of text??

    hello
    how can i set the size of JTextPane according to the size of text it would contain in such a way that JTextPane should not have ScrollBar.

    StanislavL wrote:
    width should be defined for your container width. suppose you have a very long row of text. Widht full screen widht it wraps into 2 lines but if you set widht of your window to half screen widht there should be 4 lines.
    But you can use the same code and get preferred widht as well.u mean like this :
    objTextPane.getParent().getWidth();Edited by: 811243 on Sep 6, 2011 5:32 AM

  • How can I filter based on the IPTC core information?

    How can I filter based on the IPTC core information? (CS6)

    "Substitution Variables" can do what you are asking for.

  • How to customize and fix permanently the size of web pages (zoom%) in Firefox as in Internet Explorer either: View - Zoom - Custom (percentage).

    How to customize and fix permanently the size of web pages (zoom%) in Firefox as in Internet Explorer either:
    View - Zoom - Custom (percentage).
    Thank you

    This may help you.
    https://support.mozilla.com/en-US/questions/894000

  • How to give error message for the screen element text field when wrong i/p

    How to give error message for the screen element text field when wrong i/p
    when wrong input given
    eg. 
    I have a text box with SBOOK-CARRID
    so when user give wrong entry in text box i.e LG
    then I should give some error stating that the the input is invalid or not available ,
    now it showing the error of standard messages,
    i want manual message to be displayed when error comes.
    Thank you,
    Regards,
    Jagrut Bharatkumar Shukla

    Hi all,
    Thank you for your valuable reply,
    but the thing is that its a screen field,
    i.e text box not a selection screen
    i created in screen layout
    with name sbook-carrid
    now i want to get error message display if wrong i/p is given
    thank you.
    Regards,
    Jagrut bharatkumar Shukla,

  • How can I get rid of the added / preset  text words included in my text messages.  It always says something like "Please call back at

    How can I get rid of the added / preset  text words included in my text messages.  It always says something like "Please call back at ###-####."

        JenJenTen,
    I understand that having a preset text that you did not want can be a bit frustrating when sending out text. To clarify, is the preset message like a signature at the end of your text? Does this only happen in text messages or when your send emails also? Is your SMS delivery confirmation on? Messaging>Settings>SMS delivery confirmation.
    LindseyT_VZW
    Follow us on Twitter @VZWSupport

  • How can i do to see the master and text values of the Key figure 0UNIT

    Hi gurus,
    How can i do to see the master and text values of the Key figure 0UNIT, please step by step, i m in the key figure 0UNIT but i want to see if the UNIT  for example BX = BOX, something like this is that i want to check,  thanks!

    If you look at the unit tables, you will see the values and texts.  It's in SPRO, not in RSA1.  My access is limited on my system here, but the documentation says to go to t-code CUNI.  I believe in that tcode you can look at all of the unit equivalencies and what each unit's text is ..... like an ea means each; KG = Kilogram; etc...
    I am on an 3.x system, so in SPRO I go to BW CIG=>General Settings=>Check units of measurement.
    Brian

  • How to check Role based on the User ID

    Hi All,
      Based on the User ID how to check the role of the particular person[ex Employee / Manager etc].In HR module in which table the details are present.
    Thanks.
    Regards
    Tina

    Hi Tina,
    Use FM: <b>HR_GETEMPLOYEEDATA_FROMUSER</b>
    This will give you all info related to User ID.
    In parameter EMPLOYEESUBGROUP , you will get position of this employee.
    Hope this helps.
    Regds,
    Akshay Bhawgat
    Note: Some points would be nice if it helps.
    Message was edited by: Akshay Bhagwat

  • I cannot see how many messages are in or the size of the trash or sent folders after upgrading to 3.1.10

    I recently upgraded my Thunderbird client to 3.1.10 from 2.2xx and I no longer can see the size of folders or how many messages are in certain folders. The folders do show how many are unread, but not the total messages or size of data in folder as I could with the previous version. If these options have been removed for some reason is there a problem with reverting to the previous version? Thanks, Dave English

    That was exactly what I was looking for. Thanks

  • How to select State based on the country

    Hi All,
    I have a requirement,i have to dynamically  populate the value in State based on the Country chosen in the drop down.
    Can you please tell me how to achieve this functionality.
    Thanks & Regards,
    Malkit Singh

    Hi, Malkit
    There is  already a cotext mapping for Sate.
    Take a look at this.
    http://scn.sap.com/message/13816883#13816883
    In your case, use these data types.
    element Country  :CountryCode;
    element State   :RegionCode;
    Regards,
    Fred.

  • How to create monitor based on the data collected by rule?

    I have an application which comes with a built-in command: GetBackLogNm.exe. Running this command can get the current backlog number in the system.
    Now I need to create a monitor which should trigger the alert if the backlog keeps increasing for 2 hours. I am thinking of creating a rule which run command GetBackLogNm.exe to get the number and save it into DW. Then create a monitor based on the collected
    data. Is it the correct way? If so, can anyone give me a outline how to do so? An example would be much appreciated if possible.
    Thanks!

    Hi Jonathan, thanks for the quick reply. But System.ConsolidatorCondition seems only available for SCOM 2012. I didn't find it in 2007 libraries.
    However the idea your and Vladimir showed in this
    post is really helping. I kind of solved the issue not using the exactly the components (since it is available in 2012 only) but following the same logic.
    In general I did this:
    1. create a script rule which execute the command to get backlog number; then save the log number in the DW and the registry.
    2. just like System.Performance.DeltaValueCondition, when the second time the rule triggered by schedule, it will compare the current backlog number and the last known number stored in the registry. If the value is exceeding given threshold AND bigger than
    the last known back log number, the rule increase an counter which is also stored in the registry
    3. create an unit monitor to monitor the counter stored in the registry and will trigger the alert if the counter exceeding a given value.
    This solved the issue. But I feel a little not comfortable to store data in the registry.
    So one quick question which might be out of the this topic: what is a good way to store the data generated by one workflow and then share it with another workflow or reuse sometime later? In my case here, I used the registry key. Cook down is one option
    to share data but it is very strict and can't solve the issue I have in this case.
    Thanks again!

  • How to load DataBlock based on the Multiple Condition from another block

    Hi
    How to load a Data Block based on the Multiple values from another block. For eg.EMP is the Master Data block and SAL is the child Datablock.When query JOS% in the Master Block(EMP) then display all the Sal details in the SAL block for all the employees starting with JOS , When clicking one buton or if it is possible in the loadin of the MasterBlock

    Hi,
    I presume you are using database block relations.
    Put automatic query = yes in relation properties.
    Do you have block level trigger ON-POPULATE-DETAILS?
    In that you can find the relation and query - Using built-ins
    Find_Relation and Query_Master_Details

Maybe you are looking for

  • Can't launch PDF in Production mode

    I am publishing a Captivate CBT to my LMS, but I cannot get the Captivate program to launch the PDF's I have embedded within the text. When I publish the docs are included with the files to move to my LMS. In other words, once the Captivate program i

  • Need help on getting the column names of Tabletype

    I have a table Mapping with the following values: This Mapping table contains the table names (in Tabname) and the column names(colname) of various tables and values(ValuesTobeFilled) for the columns. I have to insert into the tables present in the T

  • Trying to run a Web Dynpro Simple Sample with no luck??

    Hi I have downloaded a Web Dynpro and BPM simple sample application from this location: The problem is after configuring the CE instance and setting everything up, when i Deploy and Run this app i get the following error displayed can some one please

  • What's wrong with my iPhone 4 Bluetooth?

    I just bought a new iPhone 4 today, and when I tried to use Bluetooth to send file and receive file, they all failed. It's like when I tried to use other device to send a file to the iPhone, at first it couldn't even find the iPhone, after I turned o

  • Oracle on solaris 10

    please give me link for oracle 10g installation guide on solaris 10