Java Doc for StyledDocument.java in  » 6.0-JDK-Core » swing » javax » swing » text » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » swing » javax.swing.text 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


javax.swing.text.StyledDocument

All known Subclasses:   javax.swing.text.DefaultStyledDocument,
StyledDocument
public interface StyledDocument extends Document(Code)
Interface for a generic styled document.
author:
   Timothy Prinzing
version:
   1.28 05/05/07




Method Summary
public  StyleaddStyle(String nm, Style parent)
     Adds a new style into the logical style hierarchy.
public  ColorgetBackground(AttributeSet attr)
     Takes a set of attributes and turn it into a background color specification.
public  ElementgetCharacterElement(int pos)
     Gets the element that represents the character that is at the given offset within the document.
public  FontgetFont(AttributeSet attr)
     Takes a set of attributes and turn it into a font specification.
public  ColorgetForeground(AttributeSet attr)
     Takes a set of attributes and turn it into a foreground color specification.
public  StylegetLogicalStyle(int p)
     Gets a logical style for a given position in a paragraph.
public  ElementgetParagraphElement(int pos)
     Gets the element that represents the paragraph that encloses the given offset within the document.
public  StylegetStyle(String nm)
     Fetches a named style previously added.
public  voidremoveStyle(String nm)
     Removes a named style previously added to the document.
public  voidsetCharacterAttributes(int offset, int length, AttributeSet s, boolean replace)
     Changes the content element attributes used for the given range of existing content in the document.
public  voidsetLogicalStyle(int pos, Style s)
     Sets the logical style to use for the paragraph at the given position.
public  voidsetParagraphAttributes(int offset, int length, AttributeSet s, boolean replace)
     Sets paragraph attributes.
Parameters:
  offset - the start of the change >= 0
Parameters:
  length - the length of the change >= 0
Parameters:
  s - the non-null attributes to change to.



Method Detail
addStyle
public Style addStyle(String nm, Style parent)(Code)
Adds a new style into the logical style hierarchy. Style attributes resolve from bottom up so an attribute specified in a child will override an attribute specified in the parent.
Parameters:
  nm - the name of the style (must be unique within thecollection of named styles). The name may be null if the styleis unnamed, but the caller is responsiblefor managing the reference returned as an unnamed style can'tbe fetched by name. An unnamed style may be useful for thingslike character attribute overrides such as found in a stylerun.
Parameters:
  parent - the parent style. This may be null if unspecifiedattributes need not be resolved in some other style. the style



getBackground
public Color getBackground(AttributeSet attr)(Code)
Takes a set of attributes and turn it into a background color specification. This might be used to specify things like brighter, more hue, etc.
Parameters:
  attr - the set of attributes the color



getCharacterElement
public Element getCharacterElement(int pos)(Code)
Gets the element that represents the character that is at the given offset within the document.
Parameters:
  pos - the offset >= 0 the element



getFont
public Font getFont(AttributeSet attr)(Code)
Takes a set of attributes and turn it into a font specification. This can be used to turn things like family, style, size, etc into a font that is available on the system the document is currently being used on.
Parameters:
  attr - the set of attributes the font



getForeground
public Color getForeground(AttributeSet attr)(Code)
Takes a set of attributes and turn it into a foreground color specification. This might be used to specify things like brighter, more hue, etc.
Parameters:
  attr - the set of attributes the color



getLogicalStyle
public Style getLogicalStyle(int p)(Code)
Gets a logical style for a given position in a paragraph.
Parameters:
  p - the position >= 0 the style



getParagraphElement
public Element getParagraphElement(int pos)(Code)
Gets the element that represents the paragraph that encloses the given offset within the document.
Parameters:
  pos - the offset >= 0 the element



getStyle
public Style getStyle(String nm)(Code)
Fetches a named style previously added.
Parameters:
  nm - the name of the style the style



removeStyle
public void removeStyle(String nm)(Code)
Removes a named style previously added to the document.
Parameters:
  nm - the name of the style to remove



setCharacterAttributes
public void setCharacterAttributes(int offset, int length, AttributeSet s, boolean replace)(Code)
Changes the content element attributes used for the given range of existing content in the document. All of the attributes defined in the given Attributes argument are applied to the given range. This method can be used to completely remove all content level attributes for the given range by giving an Attributes argument that has no attributes defined and setting replace to true.
Parameters:
  offset - the start of the change >= 0
Parameters:
  length - the length of the change >= 0
Parameters:
  s - the non-null attributes to change to. Any attributesdefined will be applied to the text for the given range.
Parameters:
  replace - indicates whether or not the previousattributes should be cleared before the new attributesas set. If true, the operation will replace theprevious attributes entirely. If false, the newattributes will be merged with the previous attributes.



setLogicalStyle
public void setLogicalStyle(int pos, Style s)(Code)
Sets the logical style to use for the paragraph at the given position. If attributes aren't explicitly set for character and paragraph attributes they will resolve through the logical style assigned to the paragraph, which in turn may resolve through some hierarchy completely independent of the element hierarchy in the document.
Parameters:
  pos - the starting position >= 0
Parameters:
  s - the style to set



setParagraphAttributes
public void setParagraphAttributes(int offset, int length, AttributeSet s, boolean replace)(Code)
Sets paragraph attributes.
Parameters:
  offset - the start of the change >= 0
Parameters:
  length - the length of the change >= 0
Parameters:
  s - the non-null attributes to change to. Any attributesdefined will be applied to the text for the given range.
Parameters:
  replace - indicates whether or not the previousattributes should be cleared before the new attributesare set. If true, the operation will replace theprevious attributes entirely. If false, the newattributes will be merged with the previous attributes.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.