Implementing text comonent content scaling

Hi, I need to implement the HTML view (text fonts, images...) scaling. So how to do it? I havn't found JEditorPane is able do this and tried to run a simple test before. This code doesn't work: html_document and view are valid (non null) but the view.paint(g,r) call throws the NullPointerException. What should I get know in depth before? Could the view painted well, I tune the AffineTransform accordingly...
    class TextArea extends JPanel {
        HTMLEditorKit editor_kit;
        HTMLDocument html_document;
        ViewFactory view_factory;
        View view;
        public TextArea() {
            try {
                editor_kit=new HTMLEditorKit();
                view_factory=editor_kit.getViewFactory();
                html_document=(HTMLDocument )editor_kit.createDefaultDocument();
                URL doc_url=new URL("http://c22/j2sdk-1_4_2-doc/docs/index.html");
                InputStream stream=doc_url.openStream();
                editor_kit.read(stream,html_document,0);
                view=view_factory.create(html_document.getDefaultRootElement());
            catch (Exception e) {
                e.printStackTrace();
        protected void paintComponent(Graphics g) {
                try {
                    Dimension size=getSize();
                    Rectangle r=new Rectangle(0,0,size.width,size.height);
                    view.setSize((float )size.getWidth(),(float )size.getHeight());
                    view.paint(g,r);
                    return;               
                catch (Exception e) {
                    e.printStackTrace();
    }

try my example from the URL
http://www.developer.com/java/other/article.php/3315511
regards,
Stas

Similar Messages

  • Portal Doesn't Display page with text/plain content type

    Hi,
    I created a WSRP portlet with text/plain content type and added it to my page, but I get the following error message:
    Error: Could not get markup. The cookie or session is invalid or there is a runtime exception.
    when I add the portlet to my page.
    It works when I use text/html content, but text/plain doesn't work.
    Any ideas how I can get my portlet to display in the portal?
    Thanks in advance,
    GB

    IE6 cannot display text/plain (support.microsoft.com/kb/329661).
    Does the server know what to do (i.e. how to render) with text/plain?

  • How to Search document by using Long text description contents in SAPEasy DMS

    Hi,
    How to Search document by using Long text description contents in SAPEasy DMS
    Regards,
    Shrikant Shinde

    Hi Alfredo,
    Thanks for reply..Will you please explain in brief what are the  OCR program and workflow.
    Will you please send me any docs on [email protected]
    Thanks
    shiv.

  • How to read text file content in portal application?

    Hi,
    How do we read text file content in portal application?
    Can anyone forward the code to do do?
    Regards,
    Anagha

    Check the code below. This help you to know how to read the text file content line by line. You can display as you require.
    IUser user = WPUMFactory.getServiceUserFactory().getServiceUser("cmadmin_service");
    IResourceContext resourceContext = new ResourceContext(user);
    String filePath = "/documents/....";
    RID rid = RID.getRID(filePath);
    IResource resource = ResourceFactory.getInstance().getResource(rid,resourceContext);
    InputStream inputStream = resource.getContent().getInputStream();
    BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
    String line = reader.readLine();
    while(line!=null) {
          line = reader.readLine();
         //You can append in string buffer to get file content as string object//
    Regards,
    Yoga

  • Parsing error: Unexpected text in content of Element

    Hello,
    I have a problem that is leading me to believe that something is wrong with the struts.jar (ValidatorPlugIn class in particular) file shipped with jdeveloper 11g (11.1.1.1.0). I'm wondering if anybody has experienced this problem and maybe knows a solution.
    Following is the error that I receive when deploying the application on weblogic 10.3:
    [ERROR] Digester - Parse Error at line 5 column 100: <Line 5, Column 100>: XML-20145: (Error) Unexpected text in content of Element 'field'. <org.xml.sax.SAXParseException: <Line 5, Column 100>: XML-20145: (Error) Unexpected text in content of Element 'field'.>org.xml.sax.SAXParseException: <Line 5, Column 100>: XML-20145: (Error) Unexpected text in content of Element 'field'.
    at oracle.xml.parser.v2.XMLError.flushErrorHandler(XMLError.java:422)
    at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:287)
    at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:335)
    at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:225)
    at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:173)
    at org.apache.commons.digester.Digester.parse(Digester.java:1666)
    at org.apache.commons.validator.ValidatorResources.<init>(ValidatorResources.java:159)
    at org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.java:237)
    at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:162)
    at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:869)
    at org.apache.struts.action.ActionServlet.init(ActionServlet.java:336)
    at javax.servlet.GenericServlet.init(GenericServlet.java:241)
    at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:283)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:64)
    at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58)
    at weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper.java:48)
    at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:521)
    at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1913)
    at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1887)
    at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1805)
    at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3041)
    at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1374)
    at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:452)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
    at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
    at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
    at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:117)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
    at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
    at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)
    at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:629)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
    at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:206)
    at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:53)
    at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)
    at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
    at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:184)
    at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:361)
    at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:51)
    at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:196)
    at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)
    at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:233)
    at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:169)
    at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:123)
    at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:173)
    at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:89)
    at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    This error is referring to a file with the following contents:
    <form-validation><formset><form name="ShowNotesForm"><field property="PmnNote" depends="required"> <arg0 key="Note"/></field></form><form name="ShowAttachmentsForm"><field property="pmaAttName" depends="required"><arg0 key="Name"/></field><field property="pmaNote" depends="required"><arg0 key="Description"/></field></form></formset></form-validation>
    This error occurs wherever there is a white space or a new line character in the contents of a tag! If I have the entire file on one line, then I do not get the error.
    In the code above, I placed all the contents of the file on one line and just added one space character (it's right before <arg0 key="Note"/>), that character is causing the error and the stack trace shown above.
    If I use an older version of struts.jar (i.e. place it in the domain's lib directory so that it's added to the classpath), then I don't have a problem with white space or new line characters.
    Thanks in advance

    You are right and very sarcastic at the same time.  My bad....however, I figured out the problem, I did not close out my mysql connection and I had an extra if "}" at the end of my code.

  • Need to read text file content and have to display it in multiline text box

    dear all,
    Need to read text file content and have to display it in multiline text box.
    actually im new to file handling. i have tried up to get_line and put_line.
    in_file := TEXT_IO.FOPEN ('D:\SAMPLE.txt', 'r');
    TEXT_IO.GET_LINE (in_file,linebuf);
    i dont know how to assign this get_line function to text item
    pls help me in this regards,

    Simply write:
    in_file := TEXT_IO.FOPEN ('D:\SAMPLE.txt', 'r');
    TEXT_IO.GET_LINE (in_file,linebuf);
    :block2.t1 := chr(10)||:block2.t1||chr(10)||linebuf;
    chr(10) --> is for new line character

  • How to convert a text file content to String in JSP?

    Hi,
    I need to read the content of a text file and convert it into String and display it on to a JSP file.
    But the codings below don't work. Please advise me on how can i display the text file content.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    File adCheck = new File("list.txt");
    fis = new FileInputStream(adCheck);
    int Length = adCheck.length();
    byte arr[] = new byte[Length];
    int dataRead = 0;
    int totalData = 0;
    while(totalData <Length)
         dataRead = fis.read(arr,totalData,Length);
         totalData += dataRead;
    String Content = new String(arr);//byte array converted to String
    arr = null;

         InputStreamReader in=new InputStreamReader(fis);
          StringWriter out=new StringWriter();
          char[] buffer=new char[8192];
          int sizeRead;
          while ( ( sizeRead=in.read(buffer, 0, 8192) ) != -1 )
            out.write(buffer, 0, sizeRead);
         String content=out.toString();

  • [svn] 4648: If text and content are both set on TextGraphic or TextView, content takes precedence.

    Revision: 4648
    Author: [email protected]
    Date: 2009-01-23 14:33:27 -0800 (Fri, 23 Jan 2009)
    Log Message:
    If text and content are both set on TextGraphic or TextView, content takes precedence. Content can then be set to null to allow text to take precedence.
    If there is no text in TextGraphic or TextView should still be able to enter text. Set contentChanged when original empty textFlow is created to make sure a flowComposer is allocated in updateDisplayList().
    QE Notes:
    Doc Notes:
    Bugs: SDK-17307, SDK-16893
    Reviewers: will be Gordan
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-17307
    http://bugs.adobe.com/jira/browse/SDK-16893
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/TextView.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/TextGraphic.as

    Hello!
    I am trying to add photos into the left editable region and text into the right editable region. Nothing happens when I try to use the Insert --> Image command on the left region and I get this error when trying to add text to the right region:

  • Its possible to change text frame contents inside group...???

    Hi Everyone,
    I'm newbibe to Indesign forums.
    I had grouped image placed on rectangle and text frame. now i need change text frame content using indesign Javascript
    Its possible to change text frame contents inside group..?
    -yajiv

    Hi Siraj,
    Thank you very much for your assistance...
    Actually I need swap both group of image and text frame to another group of image box and text frame.
    I wrote code use of you advice and i struct with errors. can you rectify this code if possible...
    Thanks in advance
    -yajiv..
    Code:
      if (app.documents.length != 0){
         if (app.selection.length != 1){
              if(app.selection[0].constructor.name == "Group"){
                   app.select(app.selection[0].allGraphics[0]);
                   var myGr1 = app.selection[0].itemLink;
                   app.select(app.selection[0].textFrames[0]);
                   var selText1 =app.selection[0].contents; 
         if(app.selection[1].constructor.name == "Group"){
              app.select(app.selection[1].allGraphics[0]);
              var myLink2 = File(app.selection[1].graphics[0].itemLink.filePath);
              app.select(app.selection[1].textFrames[0]);
              var selText2 =app.selection[0].contents; 
              myGr1.relink (myLink2);
              myGr1.update();
              myGr2.relink (myLink1);
              myGr2.update();
              app.selection[0].contents=selText2;
              app.selection[1].contents=selText1;
         else{alert("Please select the two selection....!!!");}

  • JEditorPane with text/html content-type still displaying as plain-text?

    Hello all,
    I recently started work on a very basic HTTP GET program that gets the HTML source of a page and, using a JEditorPane, displays the page as normal (i.e. like a browser would).
    Anywhoo, the HTTP GET is fine, and the source is loaded into a String called "html". Then I do this:
    displayArea.createEditorKitForContentType("text/html");
                        displayArea.setText(html);However the content appears in the editor pane as plain-text (i.e. the HTML code appears as-is, not in a 'compiled' form).
    Any ideas why this is?
    Thanks,
    Tristan

    Thanks for the replies, however the setContentType didn't work either. When I changed the code to what you suggested, nothing got inserted into the editor pane at all (i.e. no HTML - nor plain-text?). More of the code:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.*;
    import java.net.Socket;
    import java.util.Scanner;
    public class ClassName extends JFrame implements ActionListener
         public JTextField urlIn, pageIn;
         public JButton go;
         public JScrollPane scrollPane;
         public JEditorPane displayArea;
         public JPanel topPanel;
         public String url, page, html;
         public int index;
         public ClassName()
              setSize(1230,680);
              setLayout(new BorderLayout());
              JPanel topPanel = new JPanel();
              topPanel.setLayout(new FlowLayout());
              urlIn = new JTextField(18);
              pageIn = new JTextField(18);
              JButton go = new JButton("Go!");
              topPanel.add(urlIn);
              topPanel.add(pageIn);
              topPanel.add(go);
              add(topPanel, BorderLayout.NORTH);
              displayArea = new JEditorPane();
              displayArea.setEditable(false);
              add(displayArea, BorderLayout.CENTER);
              go.addActionListener(this);
              urlIn.addActionListener(this);
              setVisible(true);
         public static void main(String args[])
              new ClassName();
         public void actionPerformed(ActionEvent e)
              if( e.getActionCommand() == "Go!" )
                   url = urlIn.getText();
                   page = pageIn.getText();
                   if (url != null && page != null )
                        try
                             final int HTTP_PORT = 80;
                             Socket s = new Socket(url, HTTP_PORT);
                             InputStream inStream = s.getInputStream();
                             OutputStream outStream = s.getOutputStream();
                             Scanner in = new Scanner (inStream);
                             PrintWriter out = new PrintWriter(outStream);
                             out.print("GET " + page + " HTTP/1.0\n\n");
                             out.flush();
                             while( in.hasNextLine() )
                                  String input = in.nextLine();
                                  html = html + input;
                             s.close();
                        catch (Exception exception)
                             System.out.println("Error: " + exception);
                        displayArea.setContentType("text/html");
                        displayArea.setText(html);
                        urlIn.setText("");
                        pageIn.setText("");
                 else
                      System.out.println("Please enter something!");
    }Am baffled as to what the problem is? :-(
    Thanks,
    Tristan

  • Text display and scaling issue

    Hello,
    I don't know if this is done by design, but after I released our internal newspaper build on Flex, the number one complaint I received was that when zooming in, the space between the letter was not consistent and in some of the words, the letter are either too far spaced or glued to each other.
    I build a little test app to demonstrate what I mean.
    I will first post the results and then the code.
    First here is a snapshot of text at scale 1: Everything looks great
    Now, here is the same text at scale 1.5: (I only scale x and y, it never occur to me at first that I should use z as well)
    Notice how crisp the text is but the downside are the distorded words: I highlighted a few in yellow.
    So then I figured I give a shot to the z axis and scale that one as well: to my satisfaction the words keep their spacing but the crispiness of the text, not so good!
    Here is the little app:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application 
    xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="
    library://ns.adobe.com/flex/spark" xmlns:mx="
    library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
    <fx:Declarations>
    <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <fx:Script>
    <![CDATA[
    private function Size(value:Number, useZ:Boolean=false):void
    this.TextToSize.scaleX = value; 
    this.TextToSize.scaleY = value; 
    if(useZ){
    this.TextToSize.scaleZ = value;}
    else
    this.TextToSize.scaleZ = 1;}
    ]]>
    </fx:Script>
    <s:VGroup>
    <s:HGroup>
    <s:Button label="Scale 1" click="Size(1)">
    </s:Button>
    <s:Button label="Scale 1.5" click="Size(1.5)">
    </s:Button>
    <s:Button label="Scale 1.5 All Dimensions" click="Size(1.5, true)">
    </s:Button>
    </s:HGroup>
    <s:RichEditableText id="TextToSize" editable="false" fontFamily="Verdana" fontSize="10" width="300">
    <s:content>
    <s:p>
    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum
    </s:p>
    </s:content>
    </s:RichEditableText>
    </s:VGroup>
    </s:Application>
    So now the big question:
    Is there a way to get the best of both world? Even word sizing, with crisp text?
    Did I miss something, a property that would adjust the fuzziness?
    Thanks for any input
    CNB

    I can use mobile skins for RichText and RichEditableText components for desktop and web projects, but there is a little problem. They have no mobile skins and they are paradoxically not recomended by adobe to use within mobile projects, because they are heavy. But they work great even if they are scaled. Do you still think that this is not a bug?
    http://help.adobe.com/en_US/flex/mobileapps/WS19f279b149e7481c6a9f451212b87fe7e87-7fff.htm l#WS19f279b149e7481c6a9f451212b87fe7e87-7ffb
    "Try to avoid using the RichText and RichEditableText controls in mobile applications. These controls do not have mobile skins, and they are not optimized for mobile applications. If you do use these controls, you are using TLF, which is computationally expensive."
    Is there any chance that this bug will be resolved soon, or do I have to go back to 2004 and make my own class extended from TextField? :-))

  • Text clipping content disappeared on Google Drive

    I am running OS 10.7.5 on 2009 Mac Pro. I created some text clipping files by selecting text from some web pages (in latest version Firefox) and dragging to a folder on my Google Drive. When I  open them at a remote location on a different machine which also shares/syncs my Google Drive folder, the contents of the text clippings has disappeared. On the bottom of the text clipping window there appears "clipping contents: unknown" instead of "clipping contents: text" that appears with a normal clipping file. When I create a clipping file on my desktop, upload it manually to Google Drive and then check my Google Drive folder (where it syncs almost immediately) The same thing happens. So Google Drive does not like clipping files. Question is, what about them causes Google Drive to drop their content? Is this, as I would expect, common to all versions of Mac OS or peculiar to Lion? Thanks for any insights.

    Hello,
    I'm giving a try at your application and so far, it is great!
    I understand that you're working on a way to help moving back files to google drive. Actually, I can copy / paste, but it always renames the files, so I end up with both a "copy of" and my original file.
    could you save and overwite the original file when it already exists ? (perhaps an option in the settings) ?
    Thanks!

  • Errors in implementing Text Layout Framework text flow- selection event not found

    please help me i have implemented the same project givan at adobe open source code site.
    This is my code
    <?xml version="1.0" encoding="utf-8"?>
    <!--
    ADOBE SYSTEMS INCORPORATED
    Copyright 2008 Adobe Systems Incorporated
    All Rights Reserved.
    NOTICE:  Adobe permits you to use, modify, and distribute this file
    in accordance with the terms of the Adobe license agreement
    accompanying it.  If you have received this file from a source
    other than Adobe, then your use, modification, or distribution
    of it requires the prior written permission of Adobe.
    -->
    <!-- Demonstrate some example controls.  This example does not attempt to create a control for every property in the TextLayoutFramework -->
    <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" label="Text Editor Example" initialize="init()" backgroundColor="#FFFFFF" horizontalScrollPolicy="off" verticalScrollPolicy="off">
    <mx:Script>
    <![CDATA[
    import flashx.textLayout.container.ContainerController;
    import flashx.textLayout.conversion.TextConverter;
    import flashx.textLayout.edit.EditManager;
    import flashx.textLayout.edit.IEditManager;
    import flashx.textLayout.edit.ElementRange;
    import flashx.textLayout.edit.SelectionState;
    import flashx.textLayout.elements.Configuration;
    import flashx.textLayout.elements.TextFlow;
    import flashx.textLayout.events.StatusChangeEvent;
    import flashx.textLayout.events.SelectionEvent;
    import flashx.textLayout.formats.ITextLayoutFormat;
    import flashx.textLayout.formats.TextLayoutFormat;
    import flashx.textLayout.formats.TextAlign;
    import flashx.textLayout.formats.VerticalAlign;
    import flashx.textLayout.formats.BlockProgression;
    import flashx.textLayout.formats.Direction;
    import flashx.textLayout.tlf_internal;
    import flashx.undo.UndoManager;
    import flash.display.Sprite;
    import flash.system.Capabilities;
    // the textFlow being worked on
    private var _textFlow:TextFlow = null;
    // container to hold the text
    private var _container:Sprite = null;
    // data providers for enumerated list boxes
    static private const textAlignData:Array = [
    { label:"Justify", data:TextAlign.JUSTIFY},
    { label:"Left", data:TextAlign.LEFT},
    { label:"Right", data:TextAlign.RIGHT},
    { label:"Center", data:TextAlign.CENTER},
    { label:"End", data:TextAlign.END},
    { label:"Start", data:TextAlign.START}
    static private const verticalAlignData:Array = [
    { label:"Bottom", data:VerticalAlign.BOTTOM },
    { label:"Justify", data:VerticalAlign.JUSTIFY },
    { label:"Middle", data:VerticalAlign.MIDDLE },
    { label:"Top", data:VerticalAlign.TOP }
    static private const blockProgressionData:Array = [
    { label:"TopToBottom", data:BlockProgression.TB },
    { label:"RightToleft", data:BlockProgression.RL }
    static private const directionData:Array = [
    { label:"LeftToRight", data:Direction.LTR },
    { label:"RightToleft", data:Direction.RTL }
    * initialization
    private function init():void
    // create a sprite to hold the TextLines
    _container = new Sprite();
    textArea.rawChildren.addChild(_container);
    fontFamily.dataProvider = populateFontFamily();
    versionInfo.text = "Vellum: " + flashx.textLayout.BuildInfo.kBuildNumber + (Configuration.tlf_internal::debugCodeEnabled ? " Debug" : " Release")
    + ", Flex: " + mx_internal::VERSION
    + ", Player: " + Capabilities.version;
    * Create an array of available font families
    static private function populateFontFamily():Array
    // really this returns an array of fonts - would be nice to strip it down to just the families
    var fonts:Array = Font.enumerateFonts(true);
    var fontfamily:Array = new Array();
    fonts.sortOn("fontName", Array.CASEINSENSITIVE);
    for(var i:int = 0; i< fonts.length; i++)
    // trace(fonts[i].fontName);
    fontfamily.push({label: fonts[i].fontName, data: fonts[i].fontName});
    return fontfamily;
    /** called to set the size of this panel */
    public function setSize(w:int,h:int):void
    this.width = w;
    this.height = h;
    textArea.width = width;
    textArea.height = height > bottomTabs.height ? this.height-bottomTabs.height : 0;
    if (_textFlow)
    _textFlow.flowComposer.getControllerAt(0).setCompositionSize(textArea.width,textArea.heigh t);
    _textFlow.flowComposer.updateAllControllers();
    /** called when the bottom tabs finally gets sized. */
    private function bottomTabsResize():void
    setSize(width,height);
    /** The TextFlow to edit. */
    public function get textFlow():TextFlow
    { return _textFlow; }
    public function set textFlow(newFlow:TextFlow):void
    // clear any old flow if present
    if (_textFlow)
    _textFlow.flowComposer = null;
    _textFlow = null;
    _textFlow = newFlow;
    if (_textFlow)
    _textFlow.flowComposer.addController(new ContainerController(_container,textArea.width,textArea.height));
    // setup event listeners for selection changed and ILG loaded
    _textFlow.addEventListener(SelectionEvent.SELECTION_CHANGE,selectionChangeListener,false,0 ,true);
    _textFlow.addEventListener(StatusChangeEvent.INLINE_GRAPHIC_STATUS_CHANGE,graphicStatusCha ngeEvent,false,0,true);
    // make _textFlow editable with undo
    _textFlow.interactionManager = new EditManager(new UndoManager());
    // initialize with a selection before the first character
    _textFlow.interactionManager.selectRange(0,0);
    // compose the new textFlow and give it focus
    _textFlow.flowComposer.updateAllControllers();
    _textFlow.interactionManager.setFocus();
    /** Receives an event any time an ILG with a computed size finishes loading. */
    private function graphicStatusChangeEvent(evt:StatusChangeEvent):void
    // recompose if the evt is from an element in this textFlow
    if (_textFlow && evt.element.getTextFlow() == _textFlow)
    _textFlow.flowComposer.updateAllControllers();
    /** Receives an event any time the selection is changed.  Update the UI */
    private function selectionChangeListener(e:SelectionEvent):void
    var selectionState:SelectionState = e.selectionState;
    var selectedElementRange:ElementRange = ElementRange.createElementRange(selectionState.textFlow, selectionState.absoluteStart, selectionState.absoluteEnd);
    // set display according to the values at the beginning of the selection range.  For point selection/characterFormat use getCommonCharacterFormat as that tracks pending attributes waiting for the next character
    var characterFormat:ITextLayoutFormat = _textFlow.interactionManager.activePosition == _textFlow.interactionManager.anchorPosition ? _textFlow.interactionManager.getCommonCharacterFormat() : selectedElementRange.characterFormat;
    var paragraphFormat:ITextLayoutFormat = selectedElementRange.paragraphFormat;
    var containerFormat:ITextLayoutFormat = selectedElementRange.containerFormat;
    updateComboBox(fontFamily,characterFormat.fontFamily);
    fontSize.text = characterFormat.fontSize.toString();
    lineHeight.text = characterFormat.lineHeight.toString();
    updateComboBox(textAlign,paragraphFormat.textAlign);
    textIndent.text = paragraphFormat.textIndent.toString();
    columnCount.text = containerFormat.columnCount.toString();
    columnGap.text = containerFormat.columnGap.toString();
    updateComboBox(verticalAlign,containerFormat.verticalAlign);
    updateComboBox(blockProgression,_textFlow.computedFormat.blockProgression);
    updateComboBox(directionBox,_textFlow.computedFormat.direction);
    /** Helper function to update a comboBox in the UI */
    private function updateComboBox(box:ComboBox,val:String):void
    for (var i:int = 0; i < box.dataProvider.length; i++)
    if (box.dataProvider[i].data == val)
    box.selectedIndex = i;
    return;
    box.text = val;
    * These functions are helpers for the various widgets to actually perform the operations on the TextFlow
    private function changeFontFamily(newFontFamily:String):void
    if (_textFlow && _textFlow.interactionManager is IEditManager)
    var cf:TextLayoutFormat = new TextLayoutFormat();
    cf.fontFamily = newFontFamily;
    IEditManager(_textFlow.interactionManager).applyLeafFormat(cf);
    _textFlow.interactionManager.setFocus();
    private function changeFontSize(newFontSize:String):void
    if (_textFlow && _textFlow.interactionManager is IEditManager)
    var cf:TextLayoutFormat = new TextLayoutFormat();
    cf.fontSize = newFontSize;
    IEditManager(_textFlow.interactionManager).applyLeafFormat(cf);
    _textFlow.interactionManager.setFocus();
    private function changeLeading(newLeading:String):void
    if (_textFlow && _textFlow.interactionManager is IEditManager)
    var cf:TextLayoutFormat = new TextLayoutFormat();
    cf.lineHeight = newLeading;
    IEditManager(_textFlow.interactionManager).applyLeafFormat(cf);
    _textFlow.interactionManager.setFocus();
    private function changeTextAlign(newAlign:String):void
    if (_textFlow && _textFlow.interactionManager is IEditManager)
    var pf:TextLayoutFormat = new TextLayoutFormat();
    pf.textAlign = newAlign;
    IEditManager(_textFlow.interactionManager).applyParagraphFormat(pf);
    _textFlow.interactionManager.setFocus();
    private function changeTextIndent(newIndent:String):void
    if (_textFlow && _textFlow.interactionManager is IEditManager)
    var pf:TextLayoutFormat = new TextLayoutFormat();
    pf.textIndent = newIndent;
    IEditManager(_textFlow.interactionManager).applyParagraphFormat(pf);
    _textFlow.interactionManager.setFocus();
    private function changeColumnCount(newCount:String):void
    if (_textFlow && _textFlow.interactionManager is IEditManager)
    var cf:TextLayoutFormat = new TextLayoutFormat();
    cf.columnCount = newCount;
    IEditManager(_textFlow.interactionManager).applyContainerFormat(cf);
    _textFlow.interactionManager.setFocus();
    private function changeColumnGap(newGap:String):void
    if (_textFlow && _textFlow.interactionManager is IEditManager)
    var cf:TextLayoutFormat = new TextLayoutFormat();
    cf.columnGap = newGap;
    IEditManager(_textFlow.interactionManager).applyContainerFormat(cf);
    _textFlow.interactionManager.setFocus();
    private function changeVerticalAlign(newAlign:String):void
    if (_textFlow && _textFlow.interactionManager is IEditManager)
    var cf:TextLayoutFormat = new TextLayoutFormat();
    cf.verticalAlign = newAlign;
    IEditManager(_textFlow.interactionManager).applyContainerFormat(cf);
    _textFlow.interactionManager.setFocus();
    private function changeBlockProgression(newProgression:String):void
    if (_textFlow && _textFlow.interactionManager is IEditManager)
    var cf:TextLayoutFormat = new TextLayoutFormat();
    cf.blockProgression = newProgression;
    IEditManager(_textFlow.interactionManager).applyFormatToElement(_textFlow,cf);
    _textFlow.interactionManager.setFocus();
    /** Set direction on the rootElement.  This effects both columnDirection and default reading order. */
    private function changeDirection(newDirection:String):void
    if (_textFlow && _textFlow.interactionManager is IEditManager)
    var pf:TextLayoutFormat = new TextLayoutFormat();
    pf.direction = newDirection;
    IEditManager(_textFlow.interactionManager).applyFormatToElement(_textFlow,pf);
    _textFlow.interactionManager.setFocus();
    ]]>
    </mx:Script>
    <!-- <mx:VBox horizontalScrollPolicy="off" verticalScrollPolicy="off" width="100%" height="100%"> -->
    <mx:Canvas id="textArea" width="520" height="400"/>
    <mx:TabNavigator id="bottomTabs" width="100%" creationPolicy="all" paddingLeft="4" paddingBottom="8" backgroundColor="#D9D9D9" color="#202020" horizontalScrollPolicy="off" verticalScrollPolicy="off" resize="bottomTabsResize()">
    <mx:HBox label="Text" backgroundColor="#D9D9D9" width="496" horizontalScrollPolicy="off" verticalScrollPolicy="off" >
    <mx:Label text="Font:"/>
    <mx:ComboBox id="fontFamily" editable="true" enter="changeFontFamily(fontFamily.text)"  close="changeFontFamily(fontFamily.text)" width="200"/>
    <mx:Label text="Size:"/>
    <mx:TextInput id="fontSize" enter="changeFontSize(fontSize.text)" width="40"/>
    <mx:Label text="LineHeight:"/>
    <mx:TextInput id="lineHeight" enter="changeLeading(lineHeight.text)" width="40"/>
    </mx:HBox>
    <mx:HBox label="Para" backgroundColor="#D9D9D9" width="496">
    <mx:Label text="Alignment:"/>
    <mx:ComboBox id="textAlign" close="changeTextAlign(textAlign.selectedItem.data)" dataProvider="{textAlignData}"/>
    <mx:Label text="FirstLineIdent:"/>
    <mx:TextInput id="textIndent" enter="changeTextIndent(textIndent.text)" width="40"/>
    </mx:HBox>
    <mx:HBox label="Container" backgroundColor="#D9D9D9" width="496">
    <mx:Label text="Columns:"/>
    <mx:TextInput id="columnCount" toolTip="auto or a number" enter="changeColumnCount(columnCount.text)" width="40"/>
    <mx:Label text="Gap:"/>
    <mx:TextInput id="columnGap" toolTip="a number" enter="changeColumnGap(columnGap.text)" width="40"/>
    <mx:Label text="VerticalAlignment:"/>
    <mx:ComboBox id="verticalAlign" close="changeVerticalAlign(verticalAlign.selectedItem.data)" dataProvider="{verticalAlignData}"/>
    </mx:HBox>
    <mx:HBox label="Flow" backgroundColor="#D9D9D9" width="496">
    <mx:Label text="Progression:"/>
    <mx:ComboBox id="blockProgression" close="changeBlockProgression(blockProgression.selectedItem.data)" dataProvider="{blockProgressionData}"/>
    <mx:Label text="Direction:"/>
    <mx:ComboBox id="directionBox" close="changeDirection(directionBox.selectedItem.data)" dataProvider="{directionData}"/>
    </mx:HBox>
    <mx:HBox label="Version" backgroundColor="#D9D9D9" width="496">
    <mx:TextInput id="versionInfo" editable="false" width="100%"/>
    </mx:HBox>
    </mx:TabNavigator>
    <!-- </mx:VBox> -->
    </mx:VBox>

    Probably something is going wrong when the application is being built, and textLayout.SWC is not found. Are you using Flex or Flash Pro to build it? What version? Does this error come up when you build the project, or when you run it?
    Thanks,
    - robin

  • Problem in copying a text item content in forms 10.1.2 to other application

    Hi all,
    I have just upgraded my Form server 6i in Windows 2003 to to Application server 10.1.2 in Linux.
    In previos version Application Users Used to Copy some texts from other Applications like Windows NotePad or Client/server Version of Application to webforms text items or vice versa.
    In Application 10g it doesnt work. whithin the webforms we can copy and past content of texts but within Applications It doesnt wirk at all.
    we are running Forms 10.1.2 on Windows XP, using windows IE as the browser.
    Does Forms 10.1.2 use its Own clipboard?
    does anybody know any workaround to solve the problem?
    thank you in advance.
    Alireza

    Hi Mark,
    Thanks for your attention,
    I Think it's not the certification mater, because in development environment I have Stand alone OC4j installed in Windows Xp witch uses the same version of Jinitiator and copy/paste functionality works fine.
    Surprisingly when I connect to application server 10.1.2 witch is installed in Enterprise Linux from the same PC the functionality does not work.
    I cheked windows clipbord before and after running the form application from and noticed that copy/paste mechanism of form doesnt effect windows clipbord ant it somehow uses a private clipboard within itself.
    Any solution would highly be appreciated.
    Thank you in advance.
    Alireza.

  • Unable to locate the LMS's API Implementation-Error in Content Player

    Dear Guys,
    when I am playing the content in content player of Authering environment we get the following error "Unable to locate the LMS's API Implementation" ,
    Should any API be implemented explicitly?
    How can we resolve this error?
    Regards,
    Shamila.

    Hi Shamila!
    As I mentioned, you need to consult your content developer to debug this issue. In the course content(i.e. flash file) there are references to the SCORM API. These when imported in to AE loose the reference. For instance, if you have something like this .. parent.api.<some scrom function> and the parent (window or frame) has the SCORM API. This reference might be getting broken when the course package is imported in to AE. The content developer need to make changes in the code to ensure the reference to the API is changed.
    Please let me know if you require further guidance on this.
    Regards,
    Ravi Sekhar

Maybe you are looking for

  • Hi, I want to create an alert message in the sqldeveloper

    I am using v. 1.2.0 Is there an option to pop-up a message in a window when using sqldeveloper? I did like a very small user-interface, I insert values to variables with : x:=&insert_first_num y:=&insert_second etc' I want to do somehow a message tha

  • How to protect applications running in Weblogic using OAM

    Hi all, I have a doubt, I have 2 application running in weblogic. I need to protect those application using OAM and provide single sign on. How this can be done? In the OAM integration guide i saw OAM with BEA Weblogic SSPI Is SSPI like a connector r

  • Can't get sound out of imac

    I am a musician and am trying to mix down some tracks off of a hard disk. I have a hard disc recorder and a mixing board that i am running into an M-audio Firewire solo. I have the signal flow going into the firewire solo and then into my mac. when i

  • [JS CS3] can windows be stacked?

    Hello, I have a script that calls up a window, let's name it Master. The master in turn has many buttons to run many scripts. The scripts that take a long time to run also call up a window that states "Wait a sec, I'm working." It closes once the scr

  • Can't update my macbook! HELP please!!

    I have installed the 10.5.2 version and I've been trying to update my mac with the combo update but when it starts installing an error window appears. It says I don't have the access privileges but I'm the administrator and the only account so I shou