44 |
import java.awt.font.FontRenderContext; |
import java.awt.font.FontRenderContext; |
45 |
import java.awt.font.GlyphVector; |
import java.awt.font.GlyphVector; |
46 |
import java.awt.font.LineMetrics; |
import java.awt.font.LineMetrics; |
47 |
|
import java.awt.font.TextAttribute; |
48 |
import java.awt.font.TextLayout; |
import java.awt.font.TextLayout; |
49 |
import java.awt.geom.AffineTransform; |
import java.awt.geom.AffineTransform; |
50 |
import java.awt.geom.Rectangle2D; |
import java.awt.geom.Rectangle2D; |
52 |
import java.io.IOException; |
import java.io.IOException; |
53 |
import java.io.InputStream; |
import java.io.InputStream; |
54 |
import java.io.Serializable; |
import java.io.Serializable; |
55 |
import java.text.AttributedCharacterIterator; |
import static java.text.AttributedCharacterIterator.Attribute; |
56 |
import java.text.CharacterIterator; |
import java.text.CharacterIterator; |
57 |
import java.text.StringCharacterIterator; |
import java.text.StringCharacterIterator; |
58 |
import java.util.HashMap; |
import java.util.HashMap; |
349 |
this.peer = getPeerFromToolkit (name, attrs); |
this.peer = getPeerFromToolkit (name, attrs); |
350 |
} |
} |
351 |
|
|
352 |
public Font (Map attrs) |
public Font (Map<? extends Attribute, ?> attrs) |
353 |
{ |
{ |
354 |
this(null, attrs); |
this(null, attrs); |
355 |
} |
} |
770 |
* |
* |
771 |
* @since 1.2 |
* @since 1.2 |
772 |
*/ |
*/ |
773 |
public Font deriveFont (Map attributes) |
public Font deriveFont (Map<? extends Attribute, ?> attributes) |
774 |
{ |
{ |
775 |
return peer.deriveFont (this, attributes); |
return peer.deriveFont (this, attributes); |
776 |
} |
} |
784 |
* @see java.text.AttributedCharacterIterator.Attribute |
* @see java.text.AttributedCharacterIterator.Attribute |
785 |
* @see java.awt.font.TextAttribute |
* @see java.awt.font.TextAttribute |
786 |
*/ |
*/ |
787 |
public Map getAttributes () |
public Map<TextAttribute,?> getAttributes () |
788 |
{ |
{ |
789 |
return peer.getAttributes (this); |
return peer.getAttributes (this); |
790 |
} |
} |
791 |
|
|
792 |
/** |
/** |
798 |
* @see java.text.AttributedCharacterIterator.Attribute |
* @see java.text.AttributedCharacterIterator.Attribute |
799 |
* @see java.awt.font.TextAttribute |
* @see java.awt.font.TextAttribute |
800 |
*/ |
*/ |
801 |
public AttributedCharacterIterator.Attribute[] getAvailableAttributes() |
public Attribute[] getAvailableAttributes() |
802 |
{ |
{ |
803 |
return peer.getAvailableAttributes (this); |
return peer.getAvailableAttributes (this); |
804 |
} |
} |
863 |
* |
* |
864 |
* @see java.awt.font.TextAttribute |
* @see java.awt.font.TextAttribute |
865 |
*/ |
*/ |
866 |
public static Font getFont (Map attributes) |
public static Font getFont (Map<? extends Attribute, ?> attributes) |
867 |
{ |
{ |
868 |
return getFontFromToolkit (null, attributes); |
return getFontFromToolkit (null, attributes); |
869 |
} |
} |