|
JavaTM 2 Platform Std. Ed. v1. 4.0 |
||||||||||
ÀüÀÇ Å¬·¡½º ´ÙÀ½ÀÇ Å¬·¡½º | ÇÁ·¹ÀÓ ÀÖ¾î ÇÁ·¹ÀÓ ¾øÀ½ | ||||||||||
°³¿ä: »óÀÚ | Çʵå | constructor | ¸Þ¼Òµå | »ó¼¼: Çʵå | constructor | ¸Þ¼Òµå |
java.lang.Object | +--javax.swing.text.StyleContext | +--javax.swing.text.html.StyleSheet
Ç¥Çö µÇ´Â HTML ºäÀÇ ½Ã°¢ÀûÀΠƯ¼ºÀÇ Á¤ÀǸ¦ ¼Æ÷Æ®ÇÕ´Ï´Ù. StyleSheet ´Â HTML ¸ðµ¨À» ½Ã°¢ÀûÀΠƯ¼ºÀ¸·Î º¯È¯Çϱâ À§Çؼ(¶§¹®¿¡) »ç¿ëµË´Ï´Ù. À̰ÍÀ» »ç¿ëÇØ, Ç¥½ÃÀÇ Look & Feel ¸¦ Ä¿½ºÅ͸¶ÀÌÁî Çϰųª °°Àº ¸ðµ¨¿¡ ÀÇÇÑ º¹¼öÀÇ ºä¸¦ °¢°¢ ´Ù¸¥ ÇüÅ·ΠǥÇö Çϰųª ÇÒ ¼ö ÀÖ½À´Ï´Ù. À̰ÍÀº CSS ±ÔÄ¢ ¸®Æ÷ÁöÅ͸®(repository)¶ó°í »ý°¢ÇÒ ¼ö°¡ ÀÖ½À´Ï´Ù. CSS ¼Ó¼ºÀÇ Å°´Â CSS.Attribute ÇüÀÇ ¿ÀºêÁ§Æ®ÀÔ´Ï´Ù. °ªÀÇ ÇüÅ´ StyleSheet ÀÇ ±¸Çö¿¡ ÀÀÇØ ´Ù¸¨´Ï´Ù. ´Ù¸¸, CSS Ä¡¸¦ ij¸¯ÅÍ ¶óÀΠǥÇöÀ¸·Î µ¹·ÁÁÖ·Á¸é toString
¸Þ¼Òµå°¡ ÇÊ¿äÇÕ´Ï´Ù.
HTML ÀÇ View ÀÇ ±¸ÇöÀ¸·Î ¼Ó¼ºÀ» ÃëµæÇϱâ À§ÇÑ ÁÖ¿äÇÑ ¿£Æ®¸® Æ÷ÀÎÆ®´Â getViewAttributes ¸Þ¼ÒµåÀÔ´Ï´Ù. À̰ÍÀº ¼Ó¼º°ú ºäÀÇ °ü·ÃÁö¾î¿¡ ÇÊ¿äÇÑ Æú¸®½Ã¸¦ È®¸³Çϱâ À§Çؼ ±¸ÇöÇÒ Çʿ䰡 ÀÖ½À´Ï´Ù. °¢ HTMLEditorKit (¶Ç °ü·ÃÇÏ´Â °¢ JEditorPane)´Â Àü¿ëÀÇ StyleSheet ¸¦ °¡Áú ¼ö°¡ ÀÖ½À´Ï´Ù¸¸, µðÆúÆ®¿¡¼´Â ¸ðµç HTMLEditorKit ÀÇ ÀνºÅϽº°¡ 1 °³ÀÇ ½ÃÆ®¸¦ °øÀ¯ÇÕ´Ï´Ù. HTMLDocument ÀÇ ÀνºÅϽº´Â ƯÁ¤ÀÇ ¹®¼¿ëÀÇ CSS ÁöÁ¤ÀÌ ±â¼úµÈ StyleSheet ¸¦ °¡Áú ¼öµµ ÀÖ½À´Ï´Ù.
View °¡ ÀúÀåÇÏ´Â »óŸ¦ ÁÙ¿©, ŽºÅ©¸¦ °¡º±°Ô Çϱâ À§Çؼ, StyleSheet ´Â ÀϺÎÀÇ Ç¥Çö ŽºÅ©¸¦ ó¸®ÇÏ´Â ÆäÀΟÀÇ ÆÑÅ丮·Î¼ µ¿ÀÛÇÒ ¼ö ÀÖ½À´Ï´Ù. À̰Ϳ¡ ÀÇÇØ, ±¸ÇöÀº ¹«¾ùÀ» ij½¬ÇÏ´ÂÁö 1 °³ÀÇ ½Ç·ºÅͰ¡ º¹¼öÀÇ ºä¿¡ °øÅëµÇ´Â ·¹º§·Î ¹«¾ùÀ» °øÀ¯Çұ °áÁ¤ÇÏ´Â °ÍÀÌ °¡´ÉÇÏ°Ô µË´Ï´Ù. StyleSheet ´Â º¹¼öÀÇ ¹®¼ÀÇ Ç¥½Ã·Î »ç¿ëµÇ¾î HTML ¼Ó¼ºÀº »ç¿ëµÇ´Â ½Ç·ºÅÍ¿¡´Â Åë»ó ¿µÇâÀ» ÁÖÁö ¾Ê½À´Ï´Ù. ÀÌ ¶§¹®¿¡, °øÀ¯ÀÇ °¡´É¼ºÀÌ Å©°Ô ÆÛÁý´Ï´Ù.
±ÔÄ¢Àº À̸§ ÷ºÎ ½ºÅ¸ÀϷμ º¸Á¸µÇ¾î ¿ä¼ÒÀÇ ¹®¸ÆÀ¸·ÎºÎÅÍ ±ÔÄ¢¿¡ Àçºü¸£°Ô º¯È¯Çϱâ À§Çؼ ±× ¿ÜÀÇ Á¤º¸°¡ º¸Á¸µË´Ï´Ù. ´ÙÀ½¿¡ ³ªÅ¸³»´Â Äڵ忹´Â À̸§ ÷ºÎ ½ºÅ¸ÀÏ (µû¶ó CSS ±ÔÄ¢À» Æ÷ÇÔÇÑ´Ù)À» Ç¥½ÃÇÕ´Ï´Ù.
import java.util. *;
import javax.swing.text. *;
import javax.swing.text.html. *;
public class ShowStyles {
public static void main(String[] args) {
HTMLEditorKit kit = new HTMLEditorKit();
HTMLDocument doc = (HTMLDocument) kit.createDefaultDocument();
StyleSheet styles = doc.getStyleSheet();
Enumeration rules = styles.getStyleNames();
while (rules.hasMoreElements()) {
String name = (String) rules.nextElement();
Style rule = styles.getStyle(name);
System.out.println(rule.toString());
}
System.exit(0);
}
}
¿ä¼Ò¿¡ ÀÇÇØ Á¤ÀÇµÈ ½Ã°¢ÀûÀÎ ¼Ó¼ºÀ» CSS ½ºÅ¸ÀÏÀÌ ¿À¹ö¶óÀ̵å(override) ÇÏ´Â °æ¿ìÀÇ ½Ã¸àƽ½º´Â ÃæºÐÈ÷ Á¤Àǵǰí ÀÖÁö ¾Ê½À´Ï´Ù. ¿¹¸¦ µé¾î, HTML <body bgcolor=red>
´Â º»Ã¼ÀÇ ¹é±×¶ó¿îµå¸¦ »¡°À¸·Î ÇÕ´Ï´Ù. ±×·¯³ª HTML ÆÄÀÏ¿¡ body { background: blue }
¶ó°í ÇÏ´Â CSS ±ÔÄ¢µµ ÀÖ´Â °æ¿ì, º»Ã¼ÀÇ ¹é±×¶ó¿îµå¸¦ ¹«½¼»öÀ¸·Î ÇÏ´ÂÁö ºÒ¸íÈ®ÀÌ µË´Ï´Ù. ÇöÀçÀÇ ±¸ÇöÀº ¿ä¼Ò·Î Á¤ÀÇµÈ ½Ã°¢ÀûÀÎ ¼Ó¼ºÀ» ÃÖ¿ì¼± ÇÕ´Ï´Ù. Áï, ±×·¯ÇÑ ¼Ó¼ºÀº Ç×»ó ½ºÅ¸ÀϺ¸´Ù ¸ÕÀú È®Àε˴ϴÙ. µû¶ó¼ »ó±âÀÇ ¿¹¿¡¼´Â º»Ã¼ ¿ä¼Ò°¡ ¹é±×¶ó¿îµå Ä®¶ó¸¦ »¡°¿¡ Á¤ÀÇÇϰí ÀÖ±â (À§ÇØ)¶§¹®¿¡, ¹é±×¶ó¿îµå´Â »¡°ÀÌ µË´Ï´Ù.
¹ú½á ¸»ÇÑ °Íó·³, ÀÌ ¸Þ¼Òµå´Â CSS ¸¦ ¼Æ÷Æ®ÇÕ´Ï´Ù. CSS »ç¾çÀÇ ¸ðµç °ÍÀ» ¼Æ÷Æ®Çϰí ÀÖ´Â °ÍÀº ¾Æ´Õ´Ï´Ù. ¾î´À ÇÁ·ÎÆÛƼ¸¦ ¼Æ÷Æ®Çϰí ÀÖÀ»±î¿¡ ´ëÇØ¼´Â CSS Ŭ·¡½ºÀÇ javadoc ¸¦ ÂüÁ¶ÇØ ÁÖ¼¼¿ä. ÇöÀç·Î¼´Â ¼Æ÷Æ®Çϰí ÀÖÁö ¾Ê´Â °³³ä¿¡ °ü·ÃÇÏ´Â ÁÖ¿äÇÑ CSS ±¸¹® ºÐ¼®Àº A:link { color: red }
µîÀÇ À¯»ç ½Ç·ºÅÍ¿Íimportant
¼ö½ÄÀÚÀÇ 2 °³ÀÔ´Ï´Ù.
ÁÖ: ÀÌ ±¸ÇöÀº ÇöÀç »óÅ·μ´Â ºÒ¿ÏÀüÇÕ´Ï´Ù. Àå·¡, ´ëüÀÇ ±¸Çö¿¡ ÀÇÇØ ¿Å°Ü³õÀ» ¼ö ÀÖÀ» °¡´É¼ºÀÌ ÀÖ½À´Ï´Ù. ÀÌ Å¬·¡½ºÀÇ ÇâÈÄÀÇ ¹öÁ¯¿¡¼´Â º¸´Ù ¶Ù¾î³ CSS ¼Æ÷Æ®°¡ Á¦°øµÉ ¿¹Á¤ÀÔ´Ï´Ù.
ÁßøµÈ Ŭ·¡½ºÀÇ °³¿ä | |
static class |
StyleSheet.BoxPainter
CSS Æ÷¸Ë ó¸®ÀÇ ÀϺθ¦ ½ÇÇàÇϴ Ŭ·¡½ºÀÔ´Ï´Ù. |
static class |
StyleSheet.ListPainter
CSS ¸®½ºÆ®ÀÇ Æ÷¸Ë ó¸®ÀÇ ÀϺθ¦ ½ÇÇàÇϴ Ŭ·¡½ºÀÔ´Ï´Ù. |
Ŭ·¡½º javax.swing.text. StyleContext À» »ó¼Ó¹ÞÀº ÁßøµÈ Ŭ·¡½º |
StyleContext.NamedStyle , StyleContext.SmallAttributeSet |
ÇʵåÀÇ °³¿ä |
Ŭ·¡½º javax.swing.text. StyleContext ¿¡¼ »ó¼Ó¹ÞÀº Çʵå |
DEFAULT_STYLE |
»ý¼ºÀÚÀÇ °³¿ä | |
StyleSheet ()
StyleSheet ¸¦ ±¸ÃàÇÕ´Ï´Ù. |
¸Þ¼ÒµåÀÇ °³¿ä | |
AttributeSet |
addAttribute (AttributeSet old,
Object key,
Object value)
ÁöÁ¤µÈ ¼¼Æ®¿¡ ¼Ó¼ºÀ» Ãß°¡ÇØ, »õ·Î¿î Ç¥½Ã ¼¼Æ®¸¦ µ¹·ÁÁÝ´Ï´Ù. |
AttributeSet |
addAttributes (AttributeSet old,
AttributeSet attr)
¼Ó¼º ¼¼Æ®¸¦ ¿ä¼Ò¿¡ Ãß°¡ÇÕ´Ï´Ù. |
void |
addCSSAttribute (MutableAttributeSet attr,
CSS.Attribute key,
String value)
ÁöÁ¤µÈ ¼¼Æ®¿¡ CSS ¼Ó¼ºÀ» Ãß°¡ÇÕ´Ï´Ù. |
boolean |
addCSSAttributeFromHTML (MutableAttributeSet attr,
CSS.Attribute key,
String value)
ÁöÁ¤µÈ ¼¼Æ®¿¡ CSS ¼Ó¼ºÀ» Ãß°¡ÇÕ´Ï´Ù. |
void |
addRule (String rule)
±ÔÄ¢ ¼¼Æ®¸¦ ½ÃÆ®¿¡ µî·ÏÇÕ´Ï´Ù. |
void |
addStyleSheet (StyleSheet ss)
StyleSheet ss ÀÇ ±ÔÄ¢À», ¸®½Ã¹öÀÇ ±ÔÄ¢¿¡ µî·ÏÇÕ´Ï´Ù. |
protected MutableAttributeSet |
createLargeAttributeSet (AttributeSet a)
¸Þ¸ð¸® È¿À²º¸´Ù ó¸® ½Ã°£À» ¿ì¼±ÇÏ´Â °æ¿ì¸¦ À§ÇÑ, Å« »çÀÌÁîÀÇ ¼Ó¼º ¼¼Æ®¸¦ ÀÛ¼ºÇÕ´Ï´Ù. |
protected StyleContext.SmallAttributeSet |
createSmallAttributeSet (AttributeSet a)
°øÀ¯ °¡´ÉÇϰí ÄÄÆÑÆ®ÇÑ ¼Ó¼º ¼¼Æ®¸¦ ÀÛ¼ºÇÕ´Ï´Ù. |
Color |
getBackground (AttributeSet a)
¼Ó¼º ¼¼Æ®¸¦ ÃëµæÇØ ¹é±×¶ó¿îµå Ä®¶ó ÁöÁ¤À¸·Î º¯È¯ÇÕ´Ï´Ù. |
URL |
getBase ()
º£À̽º¸¦ µ¹·ÁÁÝ´Ï´Ù. |
StyleSheet.BoxPainter |
getBoxPainter (AttributeSet a)
ÁöÁ¤µÈ CSS ¼Ó¼º¼¼Æ®·Î »ç¿ëÇÏ´Â ¹Ú½º Æ÷¸ÅÅ͸¦ ²¨³À´Ï´Ù. |
AttributeSet |
getDeclaration (String decl)
CSS ¼±¾ðÀ», CSS ¼±¾ðÀ» ³ªÅ¸³»´Â ¼Ó¼º ¼¼Æ®·Î º¯È¯ÇÕ´Ï´Ù. |
Font |
getFont (AttributeSet a)
ÁöÁ¤µÈ ¼Ó¼º ¼¼Æ®·Î »ç¿ëÇÏ´Â ÆùÆ®¸¦ ²¨³À´Ï´Ù. |
Color |
getForeground (AttributeSet a)
¼Ó¼º ¼¼Æ®¸¦ ÃëµæÇØ foreground Ä®¶ó ÁöÁ¤À¸·Î º¯È¯ÇÕ´Ï´Ù. |
static int |
getIndexOfSize (float pt)
|
StyleSheet.ListPainter |
getListPainter (AttributeSet a)
ÁöÁ¤µÈ CSS ¼Ó¼º¼¼Æ®·Î »ç¿ëÇÏ´Â ¸®½ºÆ® Æ÷¸ÅÅ͸¦ ²¨³À´Ï´Ù. |
float |
getPointSize (int index)
ÁöÁ¤µÈ »çÀÌÁî À妽ºÀÇ Æ÷ÀÎÆ® »çÀÌÁ µ¹·ÁÁÝ´Ï´Ù. |
float |
getPointSize (String size)
¡¸+2¡¹, ¡¸-2¡¹, ¡¸2¡¹µîÀÇ ÁöÁ¤µÈ ij¸¯ÅÍ ¶óÀÎÀÇ Æ÷ÀÎÆ® »çÀÌÁîÄ¡¸¦ µ¹·ÁÁÝ´Ï´Ù. |
Style |
getRule (HTML.Tag t,
Element e)
ÁöÁ¤µÈ ŸÀÔÀÇ HTML ű׸¦ Ç¥ÇöÇϱâ À§ÇÑ ½ºÅ¸ÀÏÀ» ²¨³À´Ï´Ù. |
Style |
getRule (String selector)
ij¸¯ÅÍ ¶óÀÎ Çü½Ä¿¡¼ ÁöÁ¤µÈ ½Ç·ºÅÍ¿¡ °¡Àå ÀÏÄ¡ÇÏ´Â ±ÔÄ¢À» ²¨³À´Ï´Ù. |
StyleSheet [] |
getStyleSheets ()
¸µÅ© µÈ StyleSheet ÀÇ ¹è¿À» µ¹·ÁÁÝ´Ï´Ù. |
AttributeSet |
getViewAttributes (View v)
ºä·Î Ç¥½Ã¸¦ À§Çؼ(¶§¹®¿¡) »ç¿ëµÇ´Â ¼Ó¼º ¼¼Æ®¸¦ ²¨³À´Ï´Ù. |
void |
importStyleSheet (URL url)
url ·ÎºÎÅÍ ½ºÅ¸ÀÏ ½ÃÆ®¸¦ ÀÓÆ÷Æ® ÇÕ´Ï´Ù. |
void |
loadRules (Reader in,
URL ref)
CSS1 ¹®¹ýÀÌ ÁöÁ¤ÇÏ´Â ±ÔÄ¢ ¼¼Æ®¸¦ ·ÎµåÇÕ´Ï´Ù. |
AttributeSet |
removeAttribute (AttributeSet old,
Object key)
¼Ó¼ºÀ» ¼¼Æ®·ÎºÎÅÍ »èÁ¦ÇÕ´Ï´Ù. |
AttributeSet |
removeAttributes (AttributeSet old,
AttributeSet attrs)
¼Ó¼º ¼¼Æ®¸¦ »èÁ¦ÇÕ´Ï´Ù. |
AttributeSet |
removeAttributes (AttributeSet old,
Enumeration names)
¿ä¼ÒÀÇ ¼Ó¼º ¼¼Æ®¸¦ »èÁ¦ÇÕ´Ï´Ù. |
void |
removeStyle (String nm)
ÀÌÀü¿¡ ¹®¼¿¡ Ãß°¡µÈ À̸§ ÷ºÎ ¼½ÄÀ» »èÁ¦ÇÕ´Ï´Ù. |
void |
removeStyleSheet (StyleSheet ss)
¸®½Ã¹öÀÇ StyleSheet ss ·ÎºÎÅÍ StyleSheet ss ¸¦ »èÁ¦ÇÕ´Ï´Ù. |
void |
setBase (URL base)
º£À̽º¸¦ ¼³Á¤ÇÕ´Ï´Ù. |
void |
setBaseFontSize (int sz)
1 ~ 7 ÀÇ À¯È¿ÇÑ °ªÀ¸·Î, º£À̽º font size¸¦ ¼³Á¤ÇÕ´Ï´Ù. |
void |
setBaseFontSize (String size)
°Ç³×¹ÞÀº String ·ÎºÎÅÍ º£À̽º font size¸¦ ¼³Á¤ÇÕ´Ï´Ù. |
Color |
stringToColor (String string)
¡¸RED¡¹¶Ç´Â ¡¸#NNNNNN¡¹µîÀÇ ¿¬¾Ö ÆíÁöÀÚ¿À» Color ·Î º¯È¯ÇÕ´Ï´Ù. |
AttributeSet |
translateHTMLToCSS (AttributeSet htmlAttrSet)
HTML ¼Ó¼º¼¼Æ®¸¦, µ¿µîÀÇ CSS ¼Ó¼º¼¼Æ®·Î º¯È¯ÇÕ´Ï´Ù. |
Ŭ·¡½º javax.swing.text. StyleContext ¿¡¼ »ó¼Ó¹ÞÀº ¸Þ¼Òµå |
addChangeListener , addStyle , getChangeListeners , getCompressionThreshold , getDefaultStyleContext , getEmptySet , getFont , getFontMetrics , getStaticAttribute , getStaticAttributeKey , getStyle , getStyleNames , readAttributes , readAttributeSet , reclaim , registerStaticAttributeKey , removeChangeListener , toString , writeAttributes , writeAttributeSet |
Ŭ·¡½º java.lang. Object ¿¡¼ »ó¼Ó¹ÞÀº ¸Þ¼Òµå |
clone , equals , finalize , getClass , hashCode , notify , notifyAll , wait , wait , wait |
»ý¼ºÀÚÀÇ »ó¼¼ |
public StyleSheet()
¸Þ¼ÒµåÀÇ »ó¼¼ |
public Style getRule(HTML.Tag t, Element e)
t
- ½Ã°¢ÀûÀÎ ¼Ó¼ºÀ¸·Î º¯È¯Çϴ ŸÀÔe
- ű׸¦ ³ªÅ¸³»´Â ¿ä¼Ò. ¿ä¼Ò´Â ¼Ó¼ºÀÌ ´Ù¸¥ °æ¿ì¿¡ »óÀÚ Ã³¸®ÀÇ ÆÇÁ¤¿¡ »ç¿ëÇÒ ¼ö°¡ ÀÖ´Ù (´Ù¸¥ ¿ä¼Ò³»¿¡¼ÀÇ »óÀÚ Ã³¸®ÀÇ °æ¿ì)
public Style getRule(String selector)
selector
´Â ½ºÆäÀ̽º¿¡¼ ´Ü¶ôÁö¾îÁø ¿ä¼Ò¸íÀÇ String ÀÔ´Ï´Ù. ¿¹¸¦ µé¾î html body tr td µîÀÔ´Ï´Ù.
µ¹·ÁÁÖ¾îÁö´Â Style ÀÇ ¼Ó¼ºÀº ±ÔÄ¢ÀÌ Ãß°¡µÇ°Å³ª »èÁ¦ µÇ°Å³ª ÇÑ´Ù°í º¯°æµË´Ï´Ù. Áï, ½Ç·ºÅÍ table p ¸¦ °¡Áö´Â ±ÔÄ¢À» ¿ä±¸ÇÏ´Â °æ¿ì, p ¶ó°í ÇÏ´Â ½Ç·ºÅ͸¦ °¡Áö´Â »õ·Î¿î ±ÔÄ¢ÀÌ Ãß°¡µÇ°í ÀÖÀ¸¸é(ÀÚ), µ¹·ÁÁÖ¾îÁö´Â Style ¿¡´Â ±ÔÄ¢ p ·ÎºÎÅÍÀÇ »õ·Î¿î ¼Ó¼ºÀÌ Æ÷ÇԵȴٰí ÇÏ´Â °ÍÀÔ´Ï´Ù.
public void addRule(String rule)
public AttributeSet getDeclaration(String decl)
public void loadRules(Reader in, URL ref) throws IOException
in
- CSS ¹®¹ýÀÇ read¿ø½ºÆ®¸²ref
- ÂüÁ¶ URL. ÀÌ °ªÀº ½ºÆ®¸²ÀÇ À§Ä¡¸¦ ³ªÅ¸³», ³»¿ëÀº null. ½ºÆ®¸²À¸·Î ÁöÁ¤µÇ´Â °ü·Ã URL ´Â ¸ðµÎ ÀÌ ÆÄ¶ó¹ÌÅÍ¿¡ ±Ù°ÅÇÑ´Ù
IOException
public AttributeSet getViewAttributes(View v)
public void removeStyle(String nm)
StyleContext
³»ÀÇ removeStyle
nm
- »èÁ¦µÇ´Â ¼½ÄÀÇ À̸§public void addStyleSheet(StyleSheet ss)
ss
ÀÇ ±ÔÄ¢À», ¸®½Ã¹öÀÇ ±ÔÄ¢¿¡ µî·ÏÇÕ´Ï´Ù. ss
ÀÇ ±ÔÄ¢Àº ¹ú½á µî·ÏµÇ¾î ÀÖ´Â ½ºÅ¸ÀÏ ½ÃÆ®ÀÇ ±ÔÄ¢À» ¿À¹ö¶óÀ̵å(override) ÇÕ´Ï´Ù. µî·ÏµÇ¾î ÀÖ´Â StyleSheet °¡ »õ·Ó°Ô ¹Þ´Â ½ºÅ¸ÀÏ ½ÃÆ®ÀÇ ±ÔÄ¢À» ¿À¹ö¶óÀ̵å(override) ÇÒ °ÍÀº ¾ø½À´Ï´Ù.
public void removeStyleSheet(StyleSheet ss)
ss
·ÎºÎÅÍ StyleSheet ss
¸¦ »èÁ¦ÇÕ´Ï´Ù.
public StyleSheet [] getStyleSheets()
public void importStyleSheet(URL url)
url
·ÎºÎÅÍ ½ºÅ¸ÀÏ ½ÃÆ®¸¦ ÀÓÆ÷Æ® ÇÕ´Ï´Ù. °á°úÀÇ ±ÔÄ¢Àº ¸®½Ã¹ö¿¡ Á÷Á¢ µî·ÏµË´Ï´Ù. ±ÔÄ¢À» ¸®½Ã¹öÀÇ ÀϺηΠÇÏ°í ½ÍÁö ¾ÊÀº °æ¿ì´Â »õ·Î¿î StyleSheet ¸¦ ÀÛ¼ºÇØ addStyleSheet »ç¿ëÇØ ±× StyleSheet ¸¦ ¸µÅ© ½Ãŵ´Ï´Ù.
public void setBase(URL base)
base
¿¡ °ü·ÃÇÕ´Ï´Ù.
public URL getBase()
public void addCSSAttribute(MutableAttributeSet attr, CSS.Attribute key, String value)
public boolean addCSSAttributeFromHTML(MutableAttributeSet attr, CSS.Attribute key, String value)
public AttributeSet translateHTMLToCSS(AttributeSet htmlAttrSet)
public AttributeSet addAttribute(AttributeSet old, Object key, Object value)
AbstractDocument.AttributeContext
³»ÀÇ addAttribute
StyleContext
³»ÀÇ addAttribute
old
- ±¸¼Ó¼º ¼¼Æ®key
- null ÀÌ¿ÜÀÇ ¼Ó¼º Űvalue
- ¼Ó¼ºÄ¡
MutableAttributeSet.addAttribute(java.lang.Object, java.lang.Object)
public AttributeSet addAttributes(AttributeSet old, AttributeSet attr)
AbstractDocument.AttributeContext
³»ÀÇ addAttributes
StyleContext
³»ÀÇ addAttributes
old
- ±¸¼Ó¼º ¼¼Æ®attr
- Ãß°¡ÇÏ´Â ¼Ó¼º
MutableAttributeSet.addAttribute(java.lang.Object, java.lang.Object)
public AttributeSet removeAttribute(AttributeSet old, Object key)
AbstractDocument.AttributeContext
³»ÀÇ removeAttribute
StyleContext
³»ÀÇ removeAttribute
old
- ±¸¼Ó¼º ¼¼Æ®key
- null ÀÌ¿ÜÀÇ ¼Ó¼º¸í
MutableAttributeSet.removeAttribute(java.lang.Object)
public AttributeSet removeAttributes(AttributeSet old, Enumeration names)
AbstractDocument.AttributeContext
³»ÀÇ removeAttributes
StyleContext
³»ÀÇ removeAttributes
old
- ±¸¼Ó¼º ¼¼Æ®names
- ¼Ó¼º¸í
MutableAttributeSet.removeAttributes(java.util.Enumeration)
public AttributeSet removeAttributes(AttributeSet old, AttributeSet attrs)
AbstractDocument.AttributeContext
³»ÀÇ removeAttributes
StyleContext
³»ÀÇ removeAttributes
old
- ±¸¼Ó¼º ¼¼Æ®attrs
- ¼Ó¼º
MutableAttributeSet.removeAttributes(java.util.Enumeration)
protected StyleContext.SmallAttributeSet createSmallAttributeSet(AttributeSet a)
StyleContext
³»ÀÇ createSmallAttributeSet
a
- ÄÄÆÑÆ®ÇÑ Çü½Ä¿¡¼ Ç¥ÇöµÇ´Â ¼Ó¼º ¼¼Æ®protected MutableAttributeSet createLargeAttributeSet(AttributeSet a)
StyleContext
³»ÀÇ createLargeAttributeSet
a
- »çÀÌÁîÀÇ Å« Çü½Ä¿¡¼ Ç¥ÇöµÇ´Â ¼Ó¼º ¼¼Æ®public Font getFont(AttributeSet a)
StyleContext
³»ÀÇ getFont
a
- ¼Ó¼º ¼¼Æ®
public Color getForeground(AttributeSet a)
StyleContext
³»ÀÇ getForeground
a
- ¼Ó¼º ¼¼Æ®
public Color getBackground(AttributeSet a)
StyleContext
³»ÀÇ getBackground
a
- ¼Ó¼º ¼¼Æ®
public StyleSheet.BoxPainter getBoxPainter(AttributeSet a)
public StyleSheet.ListPainter getListPainter(AttributeSet a)
public void setBaseFontSize(int sz)
public void setBaseFontSize(String size)
public static int getIndexOfSize(float pt)
public float getPointSize(int index)
public float getPointSize(String size)
public Color stringToColor(String string)
|
JavaTM 2 Platform Std. Ed. v1. 4.0 |
||||||||||
ÀüÀÇ Å¬·¡½º ´ÙÀ½ÀÇ Å¬·¡½º | ÇÁ·¹ÀÓ ÀÖ¾î ÇÁ·¹ÀÓ ¾øÀ½ | ||||||||||
°³¿ä: »óÀÚ | Çʵå | constructor | ¸Þ¼Òµå | »ó¼¼: Çʵå | constructor | ¸Þ¼Òµå |
Java, Java 2 D, ¹× JDBC ´Â ¹Ì±¹ ¹× ±× ¿ÜÀÇ ³ª¶ó¿¡ ÀÖ¾î¼ÀÇ ¹Ì±¹ Sun Microsystems, Inc. ÀÇ »óÇ¥ ȤÀº µî·Ï»óÇ¥ÀÔ´Ï´Ù.
Copyright 1993-2002 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.