You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Dmitriy Matveev (JIRA)" <ji...@apache.org> on 2007/07/06 16:56:04 UTC

[jira] Created: (HARMONY-4386) [classlib][awt]Exception when trying to use java.awt.font.LineBreakMeasurer

[classlib][awt]Exception when trying to use java.awt.font.LineBreakMeasurer
---------------------------------------------------------------------------

                 Key: HARMONY-4386
                 URL: https://issues.apache.org/jira/browse/HARMONY-4386
             Project: Harmony
          Issue Type: Bug
            Reporter: Dmitriy Matveev


Exception when trying to use java.awt.font.LineBreakMeasurer with AttributedCharacterIterator and ShapeGraphicAttribute.

Example below:

import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.font.FontRenderContext;
import java.awt.font.GraphicAttribute;
import java.awt.font.LineBreakMeasurer;
import java.awt.font.ShapeGraphicAttribute;
import java.awt.font.TextAttribute;
import java.awt.Rectangle;
import java.text.AttributedString;
import java.text.AttributedCharacterIterator;

public class TextTest {
    public static void main(String[] args) {
        Frame f = new Frame("Test"){
            public void paint(Graphics g){
                Graphics2D g2 = (Graphics2D)g;
                AttributedString as = new AttributedString("Abc");
                Shape s = new Rectangle();
                ShapeGraphicAttribute sga = new ShapeGraphicAttribute(s, GraphicAttribute.TOP_ALIGNMENT, false);
                as.addAttribute(TextAttribute.CHAR_REPLACEMENT, sga, 0, 1);
                AttributedCharacterIterator aci = as.getIterator();
                FontRenderContext frc = g2.getFontRenderContext();
                LineBreakMeasurer lbm = new LineBreakMeasurer(aci, frc);
            }
        };
        
        f.setBounds(0, 0, 800, 600);
        f.setVisible(true);
        f.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent ev) {               
                System.exit(0);
            }
        });        
    }
}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-4386) [classlib][awt] Exception when trying to use java.awt.font.LineBreakMeasurer

Posted by "Alexey Petrenko (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4386?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexey Petrenko updated HARMONY-4386:
-------------------------------------

    Comment: was deleted

> [classlib][awt] Exception when trying to use java.awt.font.LineBreakMeasurer
> ----------------------------------------------------------------------------
>
>                 Key: HARMONY-4386
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4386
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Dmitriy Matveev
>            Assignee: Alexey Petrenko
>         Attachments: Harmony-4386.patch
>
>
> Exception when trying to use java.awt.font.LineBreakMeasurer with AttributedCharacterIterator and ShapeGraphicAttribute.
> Example below:
> import java.awt.Frame;
> import java.awt.Graphics;
> import java.awt.Graphics2D;
> import java.awt.Shape;
> import java.awt.event.WindowAdapter;
> import java.awt.event.WindowEvent;
> import java.awt.font.FontRenderContext;
> import java.awt.font.GraphicAttribute;
> import java.awt.font.LineBreakMeasurer;
> import java.awt.font.ShapeGraphicAttribute;
> import java.awt.font.TextAttribute;
> import java.awt.Rectangle;
> import java.text.AttributedString;
> import java.text.AttributedCharacterIterator;
> public class TextTest {
>     public static void main(String[] args) {
>         Frame f = new Frame("Test"){
>             public void paint(Graphics g){
>                 Graphics2D g2 = (Graphics2D)g;
>                 AttributedString as = new AttributedString("Abc");
>                 Shape s = new Rectangle();
>                 ShapeGraphicAttribute sga = new ShapeGraphicAttribute(s, GraphicAttribute.TOP_ALIGNMENT, false);
>                 as.addAttribute(TextAttribute.CHAR_REPLACEMENT, sga, 0, 1);
>                 AttributedCharacterIterator aci = as.getIterator();
>                 FontRenderContext frc = g2.getFontRenderContext();
>                 LineBreakMeasurer lbm = new LineBreakMeasurer(aci, frc);
>             }
>         };
>         
>         f.setBounds(0, 0, 800, 600);
>         f.setVisible(true);
>         f.addWindowListener(new WindowAdapter() {
>             public void windowClosing(WindowEvent ev) {               
>                 System.exit(0);
>             }
>         });        
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-4386) [classlib][awt]Exception when trying to use java.awt.font.LineBreakMeasurer

Posted by "Vasily Zakharov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-4386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12512314 ] 

Vasily Zakharov commented on HARMONY-4386:
------------------------------------------

I investigated this issue. It is caused by the following line:

Font value = (Font)attributes.get(TextAttribute.CHAR_REPLACEMENT);

TextAttribute.CHAR_REPLACEMENT needs to be of class GraphicAttribute, per specification, and is used by the test appropriately.

Casting this attribute's value to Font seems trivially incorrect. And it can be easily corrected by changing the value type to Object and changing the casting type.

However, it seems logical to put the extracted GraphicAttribute value to the fonts table, so it's also necessary to change the fonts table type from HashMap<Integer, Font> to HashMap<Integer, Object>.

The attached patch makes the necessary corrections.


> [classlib][awt]Exception when trying to use java.awt.font.LineBreakMeasurer
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-4386
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4386
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Dmitriy Matveev
>
> Exception when trying to use java.awt.font.LineBreakMeasurer with AttributedCharacterIterator and ShapeGraphicAttribute.
> Example below:
> import java.awt.Frame;
> import java.awt.Graphics;
> import java.awt.Graphics2D;
> import java.awt.Shape;
> import java.awt.event.WindowAdapter;
> import java.awt.event.WindowEvent;
> import java.awt.font.FontRenderContext;
> import java.awt.font.GraphicAttribute;
> import java.awt.font.LineBreakMeasurer;
> import java.awt.font.ShapeGraphicAttribute;
> import java.awt.font.TextAttribute;
> import java.awt.Rectangle;
> import java.text.AttributedString;
> import java.text.AttributedCharacterIterator;
> public class TextTest {
>     public static void main(String[] args) {
>         Frame f = new Frame("Test"){
>             public void paint(Graphics g){
>                 Graphics2D g2 = (Graphics2D)g;
>                 AttributedString as = new AttributedString("Abc");
>                 Shape s = new Rectangle();
>                 ShapeGraphicAttribute sga = new ShapeGraphicAttribute(s, GraphicAttribute.TOP_ALIGNMENT, false);
>                 as.addAttribute(TextAttribute.CHAR_REPLACEMENT, sga, 0, 1);
>                 AttributedCharacterIterator aci = as.getIterator();
>                 FontRenderContext frc = g2.getFontRenderContext();
>                 LineBreakMeasurer lbm = new LineBreakMeasurer(aci, frc);
>             }
>         };
>         
>         f.setBounds(0, 0, 800, 600);
>         f.setVisible(true);
>         f.addWindowListener(new WindowAdapter() {
>             public void windowClosing(WindowEvent ev) {               
>                 System.exit(0);
>             }
>         });        
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-4386) [classlib][awt]Exception when trying to use java.awt.font.LineBreakMeasurer

Posted by "Dmitriy Matveev (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-4386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12511060 ] 

Dmitriy Matveev commented on HARMONY-4386:
------------------------------------------

Exception below:

java.lang.ClassCastException: java.awt.font.ShapeGraphicAttribute incompatible with java.awt.Font
	at org.apache.harmony.awt.gl.font.TextRunBreaker.createStyleRuns(TextRunBreaker.java:224)
	at org.apache.harmony.awt.gl.font.TextRunBreaker.<init>(TextRunBreaker.java:92)
	at java.awt.font.TextMeasurer.<init>(TextMeasurer.java:39)
	at java.awt.font.LineBreakMeasurer.<init>(LineBreakMeasurer.java:44)
	at java.awt.font.LineBreakMeasurer.<init>(LineBreakMeasurer.java:36)
	at JavaTest.TextTest$1.paint(TextTest.java:29)
	at java.awt.Component.processPaintEvent(Component.java:3692)
	at java.awt.Component.dispatchEvent(Component.java:3519)
	at java.awt.EventQueueCore.dispatchEventImpl(EventQueueCore.java:149)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:144)
	at java.awt.EventDispatchThread.runModalLoop(EventDispatchThread.java:74)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:48)

To view the exception "// t.printStackTrace();" line in void runModalLoop(ModalContext context) method of EventDispatchThread need to be uncommented.

> [classlib][awt]Exception when trying to use java.awt.font.LineBreakMeasurer
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-4386
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4386
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Dmitriy Matveev
>
> Exception when trying to use java.awt.font.LineBreakMeasurer with AttributedCharacterIterator and ShapeGraphicAttribute.
> Example below:
> import java.awt.Frame;
> import java.awt.Graphics;
> import java.awt.Graphics2D;
> import java.awt.Shape;
> import java.awt.event.WindowAdapter;
> import java.awt.event.WindowEvent;
> import java.awt.font.FontRenderContext;
> import java.awt.font.GraphicAttribute;
> import java.awt.font.LineBreakMeasurer;
> import java.awt.font.ShapeGraphicAttribute;
> import java.awt.font.TextAttribute;
> import java.awt.Rectangle;
> import java.text.AttributedString;
> import java.text.AttributedCharacterIterator;
> public class TextTest {
>     public static void main(String[] args) {
>         Frame f = new Frame("Test"){
>             public void paint(Graphics g){
>                 Graphics2D g2 = (Graphics2D)g;
>                 AttributedString as = new AttributedString("Abc");
>                 Shape s = new Rectangle();
>                 ShapeGraphicAttribute sga = new ShapeGraphicAttribute(s, GraphicAttribute.TOP_ALIGNMENT, false);
>                 as.addAttribute(TextAttribute.CHAR_REPLACEMENT, sga, 0, 1);
>                 AttributedCharacterIterator aci = as.getIterator();
>                 FontRenderContext frc = g2.getFontRenderContext();
>                 LineBreakMeasurer lbm = new LineBreakMeasurer(aci, frc);
>             }
>         };
>         
>         f.setBounds(0, 0, 800, 600);
>         f.setVisible(true);
>         f.addWindowListener(new WindowAdapter() {
>             public void windowClosing(WindowEvent ev) {               
>                 System.exit(0);
>             }
>         });        
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-4386) [classlib][awt] Exception when trying to use java.awt.font.LineBreakMeasurer

Posted by "Alexey Petrenko (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4386?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexey Petrenko updated HARMONY-4386:
-------------------------------------

    Summary: [classlib][awt] Exception when trying to use java.awt.font.LineBreakMeasurer  (was: [classlib][awt]Exception when trying to use java.awt.font.LineBreakMeasurer)

> [classlib][awt] Exception when trying to use java.awt.font.LineBreakMeasurer
> ----------------------------------------------------------------------------
>
>                 Key: HARMONY-4386
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4386
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Dmitriy Matveev
>            Assignee: Alexey Petrenko
>         Attachments: Harmony-4386.patch
>
>
> Exception when trying to use java.awt.font.LineBreakMeasurer with AttributedCharacterIterator and ShapeGraphicAttribute.
> Example below:
> import java.awt.Frame;
> import java.awt.Graphics;
> import java.awt.Graphics2D;
> import java.awt.Shape;
> import java.awt.event.WindowAdapter;
> import java.awt.event.WindowEvent;
> import java.awt.font.FontRenderContext;
> import java.awt.font.GraphicAttribute;
> import java.awt.font.LineBreakMeasurer;
> import java.awt.font.ShapeGraphicAttribute;
> import java.awt.font.TextAttribute;
> import java.awt.Rectangle;
> import java.text.AttributedString;
> import java.text.AttributedCharacterIterator;
> public class TextTest {
>     public static void main(String[] args) {
>         Frame f = new Frame("Test"){
>             public void paint(Graphics g){
>                 Graphics2D g2 = (Graphics2D)g;
>                 AttributedString as = new AttributedString("Abc");
>                 Shape s = new Rectangle();
>                 ShapeGraphicAttribute sga = new ShapeGraphicAttribute(s, GraphicAttribute.TOP_ALIGNMENT, false);
>                 as.addAttribute(TextAttribute.CHAR_REPLACEMENT, sga, 0, 1);
>                 AttributedCharacterIterator aci = as.getIterator();
>                 FontRenderContext frc = g2.getFontRenderContext();
>                 LineBreakMeasurer lbm = new LineBreakMeasurer(aci, frc);
>             }
>         };
>         
>         f.setBounds(0, 0, 800, 600);
>         f.setVisible(true);
>         f.addWindowListener(new WindowAdapter() {
>             public void windowClosing(WindowEvent ev) {               
>                 System.exit(0);
>             }
>         });        
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (HARMONY-4386) [classlib][awt]Exception when trying to use java.awt.font.LineBreakMeasurer

Posted by "Alexey Petrenko (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4386?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexey Petrenko reassigned HARMONY-4386:
----------------------------------------

    Assignee: Alexey Petrenko

> [classlib][awt]Exception when trying to use java.awt.font.LineBreakMeasurer
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-4386
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4386
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Dmitriy Matveev
>            Assignee: Alexey Petrenko
>         Attachments: Harmony-4386.patch
>
>
> Exception when trying to use java.awt.font.LineBreakMeasurer with AttributedCharacterIterator and ShapeGraphicAttribute.
> Example below:
> import java.awt.Frame;
> import java.awt.Graphics;
> import java.awt.Graphics2D;
> import java.awt.Shape;
> import java.awt.event.WindowAdapter;
> import java.awt.event.WindowEvent;
> import java.awt.font.FontRenderContext;
> import java.awt.font.GraphicAttribute;
> import java.awt.font.LineBreakMeasurer;
> import java.awt.font.ShapeGraphicAttribute;
> import java.awt.font.TextAttribute;
> import java.awt.Rectangle;
> import java.text.AttributedString;
> import java.text.AttributedCharacterIterator;
> public class TextTest {
>     public static void main(String[] args) {
>         Frame f = new Frame("Test"){
>             public void paint(Graphics g){
>                 Graphics2D g2 = (Graphics2D)g;
>                 AttributedString as = new AttributedString("Abc");
>                 Shape s = new Rectangle();
>                 ShapeGraphicAttribute sga = new ShapeGraphicAttribute(s, GraphicAttribute.TOP_ALIGNMENT, false);
>                 as.addAttribute(TextAttribute.CHAR_REPLACEMENT, sga, 0, 1);
>                 AttributedCharacterIterator aci = as.getIterator();
>                 FontRenderContext frc = g2.getFontRenderContext();
>                 LineBreakMeasurer lbm = new LineBreakMeasurer(aci, frc);
>             }
>         };
>         
>         f.setBounds(0, 0, 800, 600);
>         f.setVisible(true);
>         f.addWindowListener(new WindowAdapter() {
>             public void windowClosing(WindowEvent ev) {               
>                 System.exit(0);
>             }
>         });        
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (HARMONY-4386) [classlib][awt] Exception when trying to use java.awt.font.LineBreakMeasurer

Posted by "Alexey Petrenko (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4386?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexey Petrenko closed HARMONY-4386.
------------------------------------


> [classlib][awt] Exception when trying to use java.awt.font.LineBreakMeasurer
> ----------------------------------------------------------------------------
>
>                 Key: HARMONY-4386
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4386
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Dmitriy Matveev
>            Assignee: Alexey Petrenko
>         Attachments: Harmony-4386.patch
>
>
> Exception when trying to use java.awt.font.LineBreakMeasurer with AttributedCharacterIterator and ShapeGraphicAttribute.
> Example below:
> import java.awt.Frame;
> import java.awt.Graphics;
> import java.awt.Graphics2D;
> import java.awt.Shape;
> import java.awt.event.WindowAdapter;
> import java.awt.event.WindowEvent;
> import java.awt.font.FontRenderContext;
> import java.awt.font.GraphicAttribute;
> import java.awt.font.LineBreakMeasurer;
> import java.awt.font.ShapeGraphicAttribute;
> import java.awt.font.TextAttribute;
> import java.awt.Rectangle;
> import java.text.AttributedString;
> import java.text.AttributedCharacterIterator;
> public class TextTest {
>     public static void main(String[] args) {
>         Frame f = new Frame("Test"){
>             public void paint(Graphics g){
>                 Graphics2D g2 = (Graphics2D)g;
>                 AttributedString as = new AttributedString("Abc");
>                 Shape s = new Rectangle();
>                 ShapeGraphicAttribute sga = new ShapeGraphicAttribute(s, GraphicAttribute.TOP_ALIGNMENT, false);
>                 as.addAttribute(TextAttribute.CHAR_REPLACEMENT, sga, 0, 1);
>                 AttributedCharacterIterator aci = as.getIterator();
>                 FontRenderContext frc = g2.getFontRenderContext();
>                 LineBreakMeasurer lbm = new LineBreakMeasurer(aci, frc);
>             }
>         };
>         
>         f.setBounds(0, 0, 800, 600);
>         f.setVisible(true);
>         f.addWindowListener(new WindowAdapter() {
>             public void windowClosing(WindowEvent ev) {               
>                 System.exit(0);
>             }
>         });        
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-4386) [classlib][awt]Exception when trying to use java.awt.font.LineBreakMeasurer

Posted by "Vasily Zakharov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4386?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vasily Zakharov updated HARMONY-4386:
-------------------------------------

    Attachment: Harmony-4386.patch

> [classlib][awt]Exception when trying to use java.awt.font.LineBreakMeasurer
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-4386
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4386
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Dmitriy Matveev
>         Attachments: Harmony-4386.patch
>
>
> Exception when trying to use java.awt.font.LineBreakMeasurer with AttributedCharacterIterator and ShapeGraphicAttribute.
> Example below:
> import java.awt.Frame;
> import java.awt.Graphics;
> import java.awt.Graphics2D;
> import java.awt.Shape;
> import java.awt.event.WindowAdapter;
> import java.awt.event.WindowEvent;
> import java.awt.font.FontRenderContext;
> import java.awt.font.GraphicAttribute;
> import java.awt.font.LineBreakMeasurer;
> import java.awt.font.ShapeGraphicAttribute;
> import java.awt.font.TextAttribute;
> import java.awt.Rectangle;
> import java.text.AttributedString;
> import java.text.AttributedCharacterIterator;
> public class TextTest {
>     public static void main(String[] args) {
>         Frame f = new Frame("Test"){
>             public void paint(Graphics g){
>                 Graphics2D g2 = (Graphics2D)g;
>                 AttributedString as = new AttributedString("Abc");
>                 Shape s = new Rectangle();
>                 ShapeGraphicAttribute sga = new ShapeGraphicAttribute(s, GraphicAttribute.TOP_ALIGNMENT, false);
>                 as.addAttribute(TextAttribute.CHAR_REPLACEMENT, sga, 0, 1);
>                 AttributedCharacterIterator aci = as.getIterator();
>                 FontRenderContext frc = g2.getFontRenderContext();
>                 LineBreakMeasurer lbm = new LineBreakMeasurer(aci, frc);
>             }
>         };
>         
>         f.setBounds(0, 0, 800, 600);
>         f.setVisible(true);
>         f.addWindowListener(new WindowAdapter() {
>             public void windowClosing(WindowEvent ev) {               
>                 System.exit(0);
>             }
>         });        
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-4386) [classlib][awt] Exception when trying to use java.awt.font.LineBreakMeasurer

Posted by "Vasily Zakharov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-4386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12512491 ] 

Vasily Zakharov commented on HARMONY-4386:
------------------------------------------

The patch applied well, thanks Alexey.


> [classlib][awt] Exception when trying to use java.awt.font.LineBreakMeasurer
> ----------------------------------------------------------------------------
>
>                 Key: HARMONY-4386
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4386
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Dmitriy Matveev
>            Assignee: Alexey Petrenko
>         Attachments: Harmony-4386.patch
>
>
> Exception when trying to use java.awt.font.LineBreakMeasurer with AttributedCharacterIterator and ShapeGraphicAttribute.
> Example below:
> import java.awt.Frame;
> import java.awt.Graphics;
> import java.awt.Graphics2D;
> import java.awt.Shape;
> import java.awt.event.WindowAdapter;
> import java.awt.event.WindowEvent;
> import java.awt.font.FontRenderContext;
> import java.awt.font.GraphicAttribute;
> import java.awt.font.LineBreakMeasurer;
> import java.awt.font.ShapeGraphicAttribute;
> import java.awt.font.TextAttribute;
> import java.awt.Rectangle;
> import java.text.AttributedString;
> import java.text.AttributedCharacterIterator;
> public class TextTest {
>     public static void main(String[] args) {
>         Frame f = new Frame("Test"){
>             public void paint(Graphics g){
>                 Graphics2D g2 = (Graphics2D)g;
>                 AttributedString as = new AttributedString("Abc");
>                 Shape s = new Rectangle();
>                 ShapeGraphicAttribute sga = new ShapeGraphicAttribute(s, GraphicAttribute.TOP_ALIGNMENT, false);
>                 as.addAttribute(TextAttribute.CHAR_REPLACEMENT, sga, 0, 1);
>                 AttributedCharacterIterator aci = as.getIterator();
>                 FontRenderContext frc = g2.getFontRenderContext();
>                 LineBreakMeasurer lbm = new LineBreakMeasurer(aci, frc);
>             }
>         };
>         
>         f.setBounds(0, 0, 800, 600);
>         f.setVisible(true);
>         f.addWindowListener(new WindowAdapter() {
>             public void windowClosing(WindowEvent ev) {               
>                 System.exit(0);
>             }
>         });        
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (HARMONY-4386) [classlib][awt] Exception when trying to use java.awt.font.LineBreakMeasurer

Posted by "Alexey Petrenko (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4386?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexey Petrenko resolved HARMONY-4386.
--------------------------------------

    Resolution: Fixed

The patch has been applied.
Please verify.

> [classlib][awt] Exception when trying to use java.awt.font.LineBreakMeasurer
> ----------------------------------------------------------------------------
>
>                 Key: HARMONY-4386
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4386
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Dmitriy Matveev
>            Assignee: Alexey Petrenko
>         Attachments: Harmony-4386.patch
>
>
> Exception when trying to use java.awt.font.LineBreakMeasurer with AttributedCharacterIterator and ShapeGraphicAttribute.
> Example below:
> import java.awt.Frame;
> import java.awt.Graphics;
> import java.awt.Graphics2D;
> import java.awt.Shape;
> import java.awt.event.WindowAdapter;
> import java.awt.event.WindowEvent;
> import java.awt.font.FontRenderContext;
> import java.awt.font.GraphicAttribute;
> import java.awt.font.LineBreakMeasurer;
> import java.awt.font.ShapeGraphicAttribute;
> import java.awt.font.TextAttribute;
> import java.awt.Rectangle;
> import java.text.AttributedString;
> import java.text.AttributedCharacterIterator;
> public class TextTest {
>     public static void main(String[] args) {
>         Frame f = new Frame("Test"){
>             public void paint(Graphics g){
>                 Graphics2D g2 = (Graphics2D)g;
>                 AttributedString as = new AttributedString("Abc");
>                 Shape s = new Rectangle();
>                 ShapeGraphicAttribute sga = new ShapeGraphicAttribute(s, GraphicAttribute.TOP_ALIGNMENT, false);
>                 as.addAttribute(TextAttribute.CHAR_REPLACEMENT, sga, 0, 1);
>                 AttributedCharacterIterator aci = as.getIterator();
>                 FontRenderContext frc = g2.getFontRenderContext();
>                 LineBreakMeasurer lbm = new LineBreakMeasurer(aci, frc);
>             }
>         };
>         
>         f.setBounds(0, 0, 800, 600);
>         f.setVisible(true);
>         f.addWindowListener(new WindowAdapter() {
>             public void windowClosing(WindowEvent ev) {               
>                 System.exit(0);
>             }
>         });        
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-4386) [classlib][awt] Exception when trying to use java.awt.font.LineBreakMeasurer

Posted by "Alexey Petrenko (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4386?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexey Petrenko updated HARMONY-4386:
-------------------------------------

    Patch Info: [Patch Available]

> [classlib][awt] Exception when trying to use java.awt.font.LineBreakMeasurer
> ----------------------------------------------------------------------------
>
>                 Key: HARMONY-4386
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4386
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Dmitriy Matveev
>            Assignee: Alexey Petrenko
>         Attachments: Harmony-4386.patch
>
>
> Exception when trying to use java.awt.font.LineBreakMeasurer with AttributedCharacterIterator and ShapeGraphicAttribute.
> Example below:
> import java.awt.Frame;
> import java.awt.Graphics;
> import java.awt.Graphics2D;
> import java.awt.Shape;
> import java.awt.event.WindowAdapter;
> import java.awt.event.WindowEvent;
> import java.awt.font.FontRenderContext;
> import java.awt.font.GraphicAttribute;
> import java.awt.font.LineBreakMeasurer;
> import java.awt.font.ShapeGraphicAttribute;
> import java.awt.font.TextAttribute;
> import java.awt.Rectangle;
> import java.text.AttributedString;
> import java.text.AttributedCharacterIterator;
> public class TextTest {
>     public static void main(String[] args) {
>         Frame f = new Frame("Test"){
>             public void paint(Graphics g){
>                 Graphics2D g2 = (Graphics2D)g;
>                 AttributedString as = new AttributedString("Abc");
>                 Shape s = new Rectangle();
>                 ShapeGraphicAttribute sga = new ShapeGraphicAttribute(s, GraphicAttribute.TOP_ALIGNMENT, false);
>                 as.addAttribute(TextAttribute.CHAR_REPLACEMENT, sga, 0, 1);
>                 AttributedCharacterIterator aci = as.getIterator();
>                 FontRenderContext frc = g2.getFontRenderContext();
>                 LineBreakMeasurer lbm = new LineBreakMeasurer(aci, frc);
>             }
>         };
>         
>         f.setBounds(0, 0, 800, 600);
>         f.setVisible(true);
>         f.addWindowListener(new WindowAdapter() {
>             public void windowClosing(WindowEvent ev) {               
>                 System.exit(0);
>             }
>         });        
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-4386) [classlib][awt] Exception when trying to use java.awt.font.LineBreakMeasurer

Posted by "Vasily Zakharov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-4386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12515022 ] 

Vasily Zakharov commented on HARMONY-4386:
------------------------------------------

Creating regression test is complicated as exception occurs in EventDispatchThread. I think this issue may be closed.


> [classlib][awt] Exception when trying to use java.awt.font.LineBreakMeasurer
> ----------------------------------------------------------------------------
>
>                 Key: HARMONY-4386
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4386
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Dmitriy Matveev
>            Assignee: Alexey Petrenko
>         Attachments: Harmony-4386.patch
>
>
> Exception when trying to use java.awt.font.LineBreakMeasurer with AttributedCharacterIterator and ShapeGraphicAttribute.
> Example below:
> import java.awt.Frame;
> import java.awt.Graphics;
> import java.awt.Graphics2D;
> import java.awt.Shape;
> import java.awt.event.WindowAdapter;
> import java.awt.event.WindowEvent;
> import java.awt.font.FontRenderContext;
> import java.awt.font.GraphicAttribute;
> import java.awt.font.LineBreakMeasurer;
> import java.awt.font.ShapeGraphicAttribute;
> import java.awt.font.TextAttribute;
> import java.awt.Rectangle;
> import java.text.AttributedString;
> import java.text.AttributedCharacterIterator;
> public class TextTest {
>     public static void main(String[] args) {
>         Frame f = new Frame("Test"){
>             public void paint(Graphics g){
>                 Graphics2D g2 = (Graphics2D)g;
>                 AttributedString as = new AttributedString("Abc");
>                 Shape s = new Rectangle();
>                 ShapeGraphicAttribute sga = new ShapeGraphicAttribute(s, GraphicAttribute.TOP_ALIGNMENT, false);
>                 as.addAttribute(TextAttribute.CHAR_REPLACEMENT, sga, 0, 1);
>                 AttributedCharacterIterator aci = as.getIterator();
>                 FontRenderContext frc = g2.getFontRenderContext();
>                 LineBreakMeasurer lbm = new LineBreakMeasurer(aci, frc);
>             }
>         };
>         
>         f.setBounds(0, 0, 800, 600);
>         f.setVisible(true);
>         f.addWindowListener(new WindowAdapter() {
>             public void windowClosing(WindowEvent ev) {               
>                 System.exit(0);
>             }
>         });        
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-4386) [classlib][awt] Exception when trying to use java.awt.font.LineBreakMeasurer

Posted by "Alexey Petrenko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-4386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12512377 ] 

Alexey Petrenko commented on HARMONY-4386:
------------------------------------------

I can not reproduce the failure on Windows and Linux.

> [classlib][awt] Exception when trying to use java.awt.font.LineBreakMeasurer
> ----------------------------------------------------------------------------
>
>                 Key: HARMONY-4386
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4386
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Dmitriy Matveev
>            Assignee: Alexey Petrenko
>         Attachments: Harmony-4386.patch
>
>
> Exception when trying to use java.awt.font.LineBreakMeasurer with AttributedCharacterIterator and ShapeGraphicAttribute.
> Example below:
> import java.awt.Frame;
> import java.awt.Graphics;
> import java.awt.Graphics2D;
> import java.awt.Shape;
> import java.awt.event.WindowAdapter;
> import java.awt.event.WindowEvent;
> import java.awt.font.FontRenderContext;
> import java.awt.font.GraphicAttribute;
> import java.awt.font.LineBreakMeasurer;
> import java.awt.font.ShapeGraphicAttribute;
> import java.awt.font.TextAttribute;
> import java.awt.Rectangle;
> import java.text.AttributedString;
> import java.text.AttributedCharacterIterator;
> public class TextTest {
>     public static void main(String[] args) {
>         Frame f = new Frame("Test"){
>             public void paint(Graphics g){
>                 Graphics2D g2 = (Graphics2D)g;
>                 AttributedString as = new AttributedString("Abc");
>                 Shape s = new Rectangle();
>                 ShapeGraphicAttribute sga = new ShapeGraphicAttribute(s, GraphicAttribute.TOP_ALIGNMENT, false);
>                 as.addAttribute(TextAttribute.CHAR_REPLACEMENT, sga, 0, 1);
>                 AttributedCharacterIterator aci = as.getIterator();
>                 FontRenderContext frc = g2.getFontRenderContext();
>                 LineBreakMeasurer lbm = new LineBreakMeasurer(aci, frc);
>             }
>         };
>         
>         f.setBounds(0, 0, 800, 600);
>         f.setVisible(true);
>         f.addWindowListener(new WindowAdapter() {
>             public void windowClosing(WindowEvent ev) {               
>                 System.exit(0);
>             }
>         });        
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-4386) [classlib][awt]Exception when trying to use java.awt.font.LineBreakMeasurer

Posted by "Dmitriy Matveev (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4386?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dmitriy Matveev updated HARMONY-4386:
-------------------------------------

    Component/s: Classlib

> [classlib][awt]Exception when trying to use java.awt.font.LineBreakMeasurer
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-4386
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4386
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Dmitriy Matveev
>
> Exception when trying to use java.awt.font.LineBreakMeasurer with AttributedCharacterIterator and ShapeGraphicAttribute.
> Example below:
> import java.awt.Frame;
> import java.awt.Graphics;
> import java.awt.Graphics2D;
> import java.awt.Shape;
> import java.awt.event.WindowAdapter;
> import java.awt.event.WindowEvent;
> import java.awt.font.FontRenderContext;
> import java.awt.font.GraphicAttribute;
> import java.awt.font.LineBreakMeasurer;
> import java.awt.font.ShapeGraphicAttribute;
> import java.awt.font.TextAttribute;
> import java.awt.Rectangle;
> import java.text.AttributedString;
> import java.text.AttributedCharacterIterator;
> public class TextTest {
>     public static void main(String[] args) {
>         Frame f = new Frame("Test"){
>             public void paint(Graphics g){
>                 Graphics2D g2 = (Graphics2D)g;
>                 AttributedString as = new AttributedString("Abc");
>                 Shape s = new Rectangle();
>                 ShapeGraphicAttribute sga = new ShapeGraphicAttribute(s, GraphicAttribute.TOP_ALIGNMENT, false);
>                 as.addAttribute(TextAttribute.CHAR_REPLACEMENT, sga, 0, 1);
>                 AttributedCharacterIterator aci = as.getIterator();
>                 FontRenderContext frc = g2.getFontRenderContext();
>                 LineBreakMeasurer lbm = new LineBreakMeasurer(aci, frc);
>             }
>         };
>         
>         f.setBounds(0, 0, 800, 600);
>         f.setVisible(true);
>         f.addWindowListener(new WindowAdapter() {
>             public void windowClosing(WindowEvent ev) {               
>                 System.exit(0);
>             }
>         });        
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.