public class DrawFactory
extends java.lang.Object
Constructor and Description |
---|
DrawFactory() |
Modifier and Type | Method and Description |
---|---|
void |
drawShape(java.awt.Graphics2D graphics, Shape<?,?> shape, java.awt.geom.Rectangle2D bounds)
Convenience method for drawing single shapes.
(绘制单个形状的便捷方法。)
|
DrawBackground |
getDrawable(Background<?,?> shape) |
DrawConnectorShape |
getDrawable(ConnectorShape<?,?> shape) |
DrawFreeformShape |
getDrawable(FreeformShape<?,?> shape) |
DrawGraphicalFrame |
getDrawable(GraphicalFrame<?,?> shape) |
DrawGroupShape |
getDrawable(GroupShape<?,?> shape) |
DrawMasterSheet |
getDrawable(MasterSheet<?,?> sheet) |
DrawPictureShape |
getDrawable(PictureShape<?,?> shape) |
Drawable |
getDrawable(Shape<?,?> shape) |
DrawSheet |
getDrawable(Sheet<?,?> sheet) |
DrawSlide |
getDrawable(Slide<?,?> sheet) |
DrawTableShape |
getDrawable(TableShape<?,?> shape) |
DrawTextBox |
getDrawable(TextBox<?,?> shape) |
DrawTextParagraph |
getDrawable(TextParagraph<?,?,?> paragraph) |
DrawTextShape |
getDrawable(TextShape<?,?> shape) |
DrawFontManager |
getFontManager(java.awt.Graphics2D graphics)
Return a FontManager, either registered beforehand or a default implementation
(返回一个 FontManager,可以是预先注册的,也可以是默认实现)
|
static DrawFactory |
getInstance(java.awt.Graphics2D graphics)
Returns the DrawFactory, preferably via a graphics instance.
(返回 DrawFactory,最好通过图形实例。)
|
DrawPaint |
getPaint(PlaceableShape<?,?> shape) |
DrawTextFragment |
getTextFragment(java.awt.font.TextLayout layout, java.text.AttributedString str) |
static void |
setDefaultFactory(DrawFactory factory)
Set a custom draw factory for the current thread.
(为当前线程设置自定义绘制工厂。)
|
public static void setDefaultFactory(DrawFactory factory)
Drawable.DRAW_FACTORY
to set the factory.
(为当前线程设置自定义绘制工厂。这是一个后备,用于用户代码无法设置图形上下文的操作。最好使用渲染提示 Drawable.DRAW_FACTORY 来设置工厂。)
factory
- the custom factory or
null
to reset/remove the default factory
(factory - 自定义工厂或 null 重置/删除默认工厂)
public static DrawFactory getInstance(java.awt.Graphics2D graphics)
graphics
- the current graphics context or null
(graphics - 当前图形上下文或 null)
public DrawMasterSheet getDrawable(MasterSheet<?,?> sheet)
public DrawTextBox getDrawable(TextBox<?,?> shape)
public DrawFreeformShape getDrawable(FreeformShape<?,?> shape)
public DrawConnectorShape getDrawable(ConnectorShape<?,?> shape)
public DrawTableShape getDrawable(TableShape<?,?> shape)
public DrawTextShape getDrawable(TextShape<?,?> shape)
public DrawGroupShape getDrawable(GroupShape<?,?> shape)
public DrawPictureShape getDrawable(PictureShape<?,?> shape)
public DrawGraphicalFrame getDrawable(GraphicalFrame<?,?> shape)
public DrawTextParagraph getDrawable(TextParagraph<?,?,?> paragraph)
public DrawBackground getDrawable(Background<?,?> shape)
public DrawTextFragment getTextFragment(java.awt.font.TextLayout layout, java.text.AttributedString str)
public DrawPaint getPaint(PlaceableShape<?,?> shape)
public void drawShape(java.awt.Graphics2D graphics, Shape<?,?> shape, java.awt.geom.Rectangle2D bounds)
Sheet.draw(Graphics2D)
(绘制单个形状的便捷方法。要绘制整个幻灯片,请使用 Sheet.draw(Graphics2D))
graphics
- the graphics context to draw to
(graphics - 要绘制到的图形上下文)
shape
- the shape
(形状——形状)
bounds
- the bounds within the graphics context to draw to
(bounds - 要绘制到的图形上下文中的边界)
public DrawFontManager getFontManager(java.awt.Graphics2D graphics)
graphics
- the graphics context holding potentially a font manager
(graphics - 可能包含字体管理器的图形上下文)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.