New to LineBreakMeasurer with tabs

Hi � can someone please check this code which is from the API. I�m trying to use it pretty much as it comes, without knowing enough to understand all of it. I added some curly braces to a couple of �if� passages (did I want to?). I�ve also added�
     attString = �this is the text I want to display preferably with \t a few \t tabs here \t and there \t in which case I�ll set tabCount to 4 � is that the idea?�;
     Graphics2D g2;
g2 = (Graphics2D) g;
     g2.setColor(Color.black);
     att = new AttributedString(attString);
     styledText = att.getIterator();
     int tabCount = 4;
�after the first line. It compiles OK, but it displays blank, unless I set tabCount to zero and (as long as I do) remove the �\t� bits, in which case I get displayed precisely this:
this is the text I want to display preferably with a few
this is the text I want to display preferably with a few tab
this is the text I want to display preferably with a few tabs
this is the text I want to display preferably with a few tabs
this is the text I want to display preferably with a few tabs
here and there in which case I�ll set tabCount to 4 � is
here and there in which case I�ll set tabCount to 4 � is t
here and there in which case I�ll set tabCount to 4 � is th
here and there in which case I�ll set tabCount to 4 � is tha
here and there in which case I�ll set tabCount to 4 � is that
here and there in which case I�ll set tabCount to 4 � is that
here and there in which case I�ll set tabCount to 4 � is that
the idea?
the idea?
Which feels like alot better than nothing! Can anyone tell from this what I need to do? Incidentally, if I put an actual tab space character into the attString text I get displayed just all the text up to the first such tab space. The code from the API is:
public void paint(Graphics graphics) {
float leftMargin = 10,
rightMargin = 310;
float[] tabStops = { 100, 250 };
int[] tabLocations = new int[tabCount+1];
int i = 0;
for (char c = styledText.first(); c != styledText.DONE; c = styledText.next()) {
if (c == '\t') {
tabLocations[i++] = styledText.getIndex();
tabLocations[tabCount] = styledText.getEndIndex() - 1;
LineBreakMeasurer measurer = new LineBreakMeasurer(styledText);
int currentTab = 0;
float verticalPos = 20;
while (measurer.getPosition() < styledText.getEndIndex()) {
boolean lineContainsText = false;
boolean lineComplete = false;
float maxAscent = 0, maxDescent = 0;
float horizontalPos = leftMargin;
Vector layouts = new Vector(1);
Vector penPositions = new Vector(1);
while (!lineComplete) {
float wrappingWidth = rightMargin - horizontalPos;
TextLayout layout = measurer.nextLayout(wrappingWidth,
tabLocations[currentTab]+1, lineContainsText);
if lineContainsText is true if (layout != null) {
layouts.addElement(layout);
penPositions.addElement(new Float(horizontalPos));
horizontalPos += layout.getAdvance();
maxAscent = Math.max(maxAscent, layout.getAscent()); maxDescent = Math.max(maxDescent,
layout.getDescent()+layout.getLeading());
} else {
lineComplete = true;
lineContainsText = true;
if (measurer.getPosition() == tabLocations[currentTab]+1) {
currentTab++;
if (measurer.getPosition() == styledText.getEndIndex()) lineComplete =
true; else if (horizontalPos >= tabStops[tabStops.length-1]) lineComplete = true;
if (!lineComplete) {
int j;
for (j=0; horizontalPos >= tabStops[j]; j++) {}
horizontalPos = tabStops[j];
verticalPos += maxAscent;
Enumeration layoutEnum = layouts.elements();
Enumeration positionEnum = penPositions.elements();
while (layoutEnum.hasMoreElements()) {
TextLayout nextLayout = (TextLayout) layoutEnum.nextElement();
Float nextPosition = (Float) positionEnum.nextElement();
nextLayout.draw(graphics, nextPosition.floatValue(), verticalPos);
verticalPos += maxDescent;
}

mac nincompoop wrote:
New to Mac. Can't find iWeb on the new iMac. Any solutions?
iLife 11 ships with new Macs includes iPhoto, iMovie & GarageBand. If you want or need iWeb you can still get it however you need to purchase the box set of iLife11. The box set includes iPhoto, iMovie, GarageBand, iWeb & iDVD. I see this is still available from Amazon for as low as 29.99. To be honest though if you have an older license of iLife you can install only iWeb.

Similar Messages

  • Just got a new Mac Mini with Lion - where is the downloads folder in the Window tab that is at the top of the page in Safari?  I used this a lot and really miss it!

    I just got a new Mac Mini with Lion - the Window tab at the top of the Safari Browser used to ahve a downloads folder in it along with Activity etc - but it is not there anymore. Any way to get it back or is there another location it sits in?  I used it when I'd copy video info from the activity folder and then paste into the download folder and presto - I downloaded the video onto my computer.  I really miss this capability!

    Download activity is found by clicking on the gadget on the right:

  • Link in emails to open the link in new tab, not a new firefox window with home page,

    Link in emails open a new Firefox window with my default home page. How do I get Firefox to open the linked web page, in an new tab, as it used to do??
    This is for Win XP, FF 17.0.1, using Outlook as mail client.

    Do you mean the results from a search via the Google search bar on the Navigation toolbar or the Firefox Google home page (www.google.com/firefox) ?
    For the Google website you can set your preferences on the Google.com page via the [http://www.google.com/preferences?hl=en Google Search settings] link at the top right.
    Results Window: Open search results in a new browser window.
    You need to allow cookies for Google (Tools > Page Info > Permissions) to save that setting, otherwise you have to repeat it.
    For the Google search bar on the Navigation toolbar you can set the pref browser.search.openintab to true on the about:config page.
    To open the <i>about:config</i> page, type <b>about:config</b> in the location (address) bar and press the "<i>Enter</i>" key, just like you type the url of a website to open a website.<br />
    If you see a warning then you can confirm that you want to access that page.<br />

  • Applying a New Template to a Page with Tabs

    Hi,
    We use page templates for our pages. We know that you cannot add a region to a page based on a template, but supposedly you can add tabs to a page based on a template.
    One template we have has a single tab on it. The web designers have been adding content to pages built on that template. When they need another tab, they add it and add content to the new region on the tab. They may do this until there are 4 tabs on the page (the original tab that is in the template, plus three additional tabs). We use this for example to collect links to memos and to divide the links onto 4 tabs representing calendar quarters.
    One of the problems with this process is that the web designers have not been consistent in using uniform definitions for the region on each tab causing an inconsistent look-and-feel from one tab to the next.
    I have created a new template with 4 tabs already defined and with the region properties already defined. The web designers can then add content as needed and if a tab is not required it can be marked as hidden.
    The problem that I am running into is that if I try to apply the new template to an existing page, I get the following error message:
    Error: ORA-00001: unique constraint (PORTAL.WWV_THINGS_NAME_UK) violated
    Also, consistently the content from the original first tab is lost and there is no corresponding tab on the reformatted page. Content on the second tab appears to be OK, but content on the third tab is missing. Content on the fourth tab appears to be OK.
    Can anyone tell me 1. what is specifically causing the error message, and 2. is it possible to do what I want to do or will all of these pages have to be recreated manually instead of changing the templates.?
    Thanks,
    Peter

    You should be able to do what you are trying to do. You seem to be running into a bug. Please file this with support if possible. Based on the error message, you seem to be running into a case of duplicate names, on either items or tabs. What you might try doing is renaming the tabs, ensuring uniqueness, before changing templates. By "renaming", I mean changing the NAME of the tab, not the Display Name, by clicking Edit Tab in edit mode. Does this help at all?

  • I am unable to sync my new iphone 4 with itunes.i am unable to see in the device tab, i am unable to sync my new iphone 4 with itunes.i am unable to see in the device tab

    i am unable to sync my new iphone 4 with itunes.i am unable to see in the device tab, i am unable to sync my new iphone 4 with itunes.i am unable to see in the device tab

    Hello Zuhaib,
    Sorry to hear that your iPhone is currently not recognized by iTunes.  I found an article with steps you can take when you experience an issue like this.  I wasn't sure whether you were using a Windows or Mac computer, so I included the respective articles for each:
    iOS: Device not recognized in iTunes for Windows
    http://support.apple.com/kb/TS1538
    iOS: Device not recognized in iTunes for Mac OS X
    http://support.apple.com/kb/TS1591
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • How to "open all in tabs" bookmarks including links in second level folders (maybe each in new window with tabs) It opens only first level links... thanks

    I mean, if I go to the main menu, bookmarks->some folder (this "some folder" includes a 5 bookmarks and "some folder 1", "some folder 2" each with own bookmarks), click "open all in tabs", then it opens only 5 bookmarks, but I want it to open bookmarks from "some folder 1", "some folder 2" too at the same time! (maybe in new windows with tabs for each "some folder 1", "some folder 2") doesn't matter.
    Is there a way to do this? Maybe addons? extensions? Maybe you could add this in future versions...
    THanks. It would be great for me and my friends. (they also asked about this)
    Sergey Knyazyuk

    Try with Firefox Addons
    *addons.mozilla.org

  • New session started with an advertizing page and all my tabs are lost

    New session started with an advertizing page and all my tabs are lost. Restore the previous session is not active. How can I restore my tabs?

    This advice might come too late, but, don't exit Firefox! Or if you already did, don't start it back up again!
    ''If Firefox is running:'' Open your current Firefox settings (AKA Firefox profile) folder using either
    * "3-bar" menu button > "?" button > Troubleshooting Information
    * (menu bar) Help > Troubleshooting Information
    * type or paste about:support in the address bar and press Enter
    In the first table on the page, click the "Show Folder" button. This should launch a new window listed various files and folders. For best results, change the view to "Details".
    (''If Firefox not running, get to this folder by pasting the following in the Run box on the start menu and pressing Enter: %APPDATA%\Mozilla\Firefox\Profiles and then double-click into the most recently updated semi-randomly-named folder you find there.'')
    In the window that launches, scroll down and double-click into the '''sessionstore-backups''' folder. Save all files here to a safe location, such as your Documents folder, so Firefox doesn't overwrite them. We may be able to use them to recover your lost tabs.
    Also, if you return to the main level of the profile folder, you may find some sessionstore files. Copy those to the safe location as well.
    Could you report back on what you found?
    Note: If Windows hides the .js file extension from you, you can change a setting so that you can see all file extensions (this helps when renaming files). This support article has the steps: http://support.microsoft.com/kb/865219 or http://windows.microsoft.com/en-us/windows/show-hide-file-name-extensions
    The kinds of files you may find among your sessionstore-backup files are:
    * recovery.js: the windows and tabs in your currently live Firefox session (or, if Firefox is closed, your last session)
    * recovery.bak: a backup copy of recovery.js
    * previous.js: the windows and tabs in your last Firefox session
    * upgrade.js-''build_id'': the windows and tabs in the Firefox session that was live at the time of your last update

  • Leaving JTextField with TAB

    A simple question really ... I have a JTextField that I would like to have the user exit from with TAB and get
    the same action as if they had left the field with the
    ENTER key, i.e., I'd like to be able to use the getText
    method to retrieve what the user entered. Currently, with
    no modifcations whatsoever to the JTextField, when I
    invoke getText after the user leaves the field with a TAB,
    getText returns NULL. I've tried just about everything,
    but can't get any of it to work (removeKeyStrokeBinding(), extending JTextField, etc.).
    Thanks in advance for any suggestions.

    As you have niticed this is not such a simple question at all.
    After some experimentation I decided to make the enter key cause the text field to loose focus.
    addKeyListener (new KeyAdapter()
    public void keyPressed (KeyEvent evt)
    int key = evt.getKeyCode();
    if (key == KeyEvent.VK_ENTER)
    transferFocus ();
    Then give the text field a focus listener
    class TextListener extends java.awt.event.FocusAdapter
    public void focusLost (FocusEvent e)
    // evalutate the text using getText()
    Which gets the field's content, validates it and then save it in the appropriate place.
    The advantage to this approach is the whole field edits are always done in the same place (the focus adapter), and the enter and tab actions appear the same to the user.
    The disadvantage is that, unless you know the initial value, you won't be able to tell if the value has changed.
    hope this helpds some.
    Terry

  • Launching with tabs from last session

    I was delighted to see that Safari 5.1.1 has a General Preference
    "Safari opens with: all windows from last session".
    I assumed this would also open all tabs.  Is there a way to get this to happen?

    Richard, try this "work around" ...
    Have tabs open when you launch Safari
    From Safari's Bookmarks menu select "Add Bookmark Folder." A new "untitled folder" will appear in the left-hand side, highlighted and ready to be named.
    You should already have separate bookmarks for each of your six desired sites. Create them if you don't. Copy each of the desired bookmarks to the newly created folder.
    Under Safari Preferences > General > "New windows open with:" select "Choose tabs folder..."
    From the popup menu select the newly created folder and press Choose.

  • Opening a new link in a tab (contr+click or right click and open in new tab) causes ff to lose scroll position in first tab or main website, like google.

    Opening a new link in a tab (contr+click or right click and open in new tab) causes ff to lose scroll position in first tab or main window, like google.
    This does not happen when opening in a new window (shift+click).
    It was never a problem in older versions. I now have ff 3.6.17. I' afraid to install ff4 because everytime i do so (install e new version) something i liked dissapears or good add ons dont work anymore!
    I also don't like the fact that more and more of the adress barr is beïng used for crap i don't need. I'm a visual handicap and need all the space i can, just to read.
    Thanks for helping me out.

    To help other users find solutions, please return to this Thread and '''Sign-in''' to the forum with your Username and Password:
    click on '''"Solved It"''' next to the reply ABOVE that '''BEST''' solved your question
    '''DO NOT click "Solved It" next to this reply

  • I wiped my ipod classic and then my computer crashed, so i no longer have the songs i purchsed from itunes on my ipod or computer! I have a new computer now with itunes installed, can I get the songs purchased previously from itunes somehow?

    I wiped my ipod classic and then my computer crashed, so i no longer have the songs i purchsed from itunes on my ipod or computer! I have a new computer now with itunes installed, can I get the songs purchased previously from itunes somehow?

    Yes, you can!(:
    STEP 1: Open iTunes
    STEP 2: Navigate to the "iTunes Store". It can be found under the "STORE" tab.
    STEP 3: On the right side of the store there should be a "Quick Links" Section. Click on the "Purchased" link.
    STEP 4: Navigate to the "Music" tab and click on "All Songs". Then at the bottom of the screen there will be a button that says "Download All". Click the button and your songs will be begin downloading!
    NOTE: This will only work with songs that you bought from the iTunes store, if you imported them from a CD, you will have to do it again.
    NOTE: You can also do this with Apps, Movies, TV Shows, and Books.
    NOTE: You may have to sign in with your Apple ID to verify the download.
    Hope this helped! Enjoy your music!(:

  • New IMac 27"with dual internal hard drives

    How do I manage Data on my new IMac 27"with dual internal hard drives?  I have just migrated my data to my new computer.  Since I've done it from a TM backup, it all went to the Analog HD. Ressearching online I've figured I could re-run Migrating assistant and replace different data between the SSD and the Analog.  My problem now is: I want to keep my Music Library (iTunes), my Aperture Library and my documents on the analog, and use the SSD for System, Users and Apps.  Aperture, is easy, because both Aperture and iPhoto can find their way, bt iTunes and My documents are a issue.  Can Anyone help me?

    Install OS X on the SSD:
    Install or Reinstall Lion/Mountain Lion from Scratch
    Be sure you backup your files to an external drive or second internal drive because the following procedure will remove everything from the hard drive.
    Boot to the Recovery HD:
    Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    Erase the hard drive:
      1. Select Disk Utility from the main menu and click on the Continue button.
      2. After DU loads select your SSD volume (usually Macintosh HD) from the left side list. Click on
          the Erase tab in the DU main window.
      3. Set the format type to Mac OS Extended (Journaled.) Optionally, click on the Security button and set the Zero
            Data option to one-pass. Click on the Erase button and wait until the process has completed.
      4. Quit DU and return to the main menu.
    Reinstall Lion: Select Reinstall Lion/Mountain Lion and click on the Install button. Be sure to change the target disk to your SSD.
    Note: You will need an active Internet connection. I suggest using Ethernet if possible because it is three times faster than wireless.
    After you boot from the SSD open Users & Groups preferences. Click on the lock and authenticate. CTRL- or RIGHT-click on the user account and select Advanced Options. You will see a Home Dir: field with a Browse button on the right. Click on the button. Navigate to the HDD's Users folder. Select your account folder then click on the Open/Choose button. You must restart immediately.
    Upon the restart your SSD system will now be using your actual Home folder located on the HDD. You can then go about installing your applications or copying them from the HDD to the Applications folder on the SSD (and also from the Utilities folder on the HDD to the one on the SSD.) You will likely need to do some transfers of the Applications Support and Preferences folders found in the main Library folder.

  • I have purchased Adobe Acrobat and my order number is 281998924. My previous Sony computer which used to Windows 7 crashed. I purchased a new Toshiba computer with Windows 8. How can I download the Adobe acrobat? I assume I don't have to pay for the progr

    I have purchased Adobe Acrobat and my order number is 281998924. My previous Sony computer which used to Windows 7 crashed. I purchased a new Toshiba computer with Windows 8. How can I download the Adobe acrobat? I assume I don't have to pay for the program again? Thank you for all your help! Angelo.

    If you had purchased Acrobat Standard subscription.
    You need to download the application from below website :
    www.cloud.acrobat.com
    Sign in with Adobe ID and Password and once signed in click on Acrobat tab and download the application.
    Sign in - Adobe ID

  • I see that i have a problem after installing my new hard drive on my macbook pro mid 2009 version. I put a new hard drive, with all of my information from my old drive installed on it, into the computer. but now have the blinking question mark folder

    i see that i have a problem after installing my new hard drive on my macbook pro mid 2009 version. I put a new hard drive, with all of my information from my old drive installed on it, into the computer. but now have the blinking question mark folder. I see that it means that it isn't reading the new hard drive.
    did i miss a step between transferring all of my information from my old hard drive to the new hard drive and installing the new hard drive into the computer. I believe that i installed properly. it was quite easy.
    thanks for your help

    It means there is no bootable system on the drive. If you still have access to the old drive, then I suggest you boot from it then clone it to the new internal drive. Use OPTION boot to boot from the Recovery HD on the old drive:
    Boot to the Recovery HD:
    Restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
         1. Select Disk Utility from the main menu then press the Continue
             button.
         2. Select the destination volume from the left side list.
         3. Click on the Restore tab in the DU main window.
         4. Select the destination volume from the left side list and drag it
             to the Destination entry field.
         5. Select the source volume from the left side list and drag it to
             the Source entry field.
         6. Double-check you got it right, then click on the Restore button.
    Source means the external old drive. Destination means the new internal drive.

  • Add a new field in the Tab Addicional data en la ME22N

    Hi,
    Please, can anyone tell me how can we add a new field in the tab Addicional data en la ME21N? I have to use the MM06E005, but I don't know which screen exit should I use and also how to add this subcreen in the tab Addicional data.
    Thanks in advance.
    Saida.

    Hi,
    using SE80 you can add your fields with subscreens
    SAPLXM06 0101 for Headerfields
    SAPLXM06 0111 for Items.
    This will add a tab in ME2..N.
    if you want your own Text on the tabstrip just edit the Textsymbols
    101 and 111 from SAPLXM06.
    At output you have to open a module asking the gl_aktyp to switch edit/display mode.
    then you must code the Exits to import/export values
    EXIT_SAPMM06E_006
    store transaction type for later modification of screen attributes
    gl_aktyp = i_trtyp.
    gl_no_screen = i_no_screen.
    store current state of customer data in ekko_ci (structure for screen)
    ekko_ci = i_ci_ekko.
    store reference document
    if i_rekko-ebeln ne gl_rekko-ebeln and
    not i_rekko-ebeln is initial and
    gl_rekko-ebeln is initial.
    ekko_ci-zzemail = i_rekko-zzemail.
    gl_rekko = i_rekko.
    endif.
    EXIT_SAPMM06E_007
    move-corresponding i_ekko to gl_ekko_ci.
    EXIT_SAPMM06E_008
    e_ci_ekko = gl_ekko_ci.
    ekko_ci contains the actual values of the Dynpro fields
    e_ci_update is only set if you really want the fields
    on the Dynpro to be saved. You must set it then to 'X'
    the field ekko_ci-zzflag will here only be saved if there
    was a change and the transaction is not in display mode
    if gl_ekko_ci-zzemail ne ekko_ci-zzemail.
    e_ci_ekko-zzemail = ekko_ci-zzemail.
    if gl_aktyp ne 'A'.
    e_ci_update = 'X'.
    endif.
    endif.
    Regards
    Kiran Sure

Maybe you are looking for

  • Mozilla Crash Reporter window continually pops up and won't let me reload firefox

    Firefox crashed. I took it off the computer and tried to reload. The window keeps popping up that says e're sorry firefox had a problem and crashed well try to restore your tabs and windows when it restarts to help us diagnonse and fix problem send u

  • Acrobat won't convert Word documents within the Acrobat program

    I am running OS 10.5.2 on my MacBook Pro. I also have Microsoft Office 2004. I just installed Acrobat 8.0 Pro, patched it all up from the downloads on the website and was ready to convert some Word documents that I have to give to my boss. Went throu

  • RMI Callback Connection Refused Problem

    we are running Red Hat Linux 9, we previously had a problem connecting a server and client running in 2 different PC's. we had the following error Exception in mainjava.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:

  • Media Source v3.30.21 does not see "Z

    I've downloaded Media Source v3.30.2 and installed it but it seems as if he does not see the Zen player. On the right screen appears the "Music bibliotheek and My computer" but not the Player itself.....to transfer music tracks to and from your Creat

  • Listary Alternative

    When I use Windows, I found a very handy but useful utility called "Listary". The greatest function of this utility is to bring you back to your working folder by just a few clicks or even not, because Listary knows where you are now, and bring you t