Agora Interactive Whiteboard Java API Reference
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
com.herewhite.sdk.Displayer Class Reference
Inheritance diagram for com.herewhite.sdk.Displayer:
com.herewhite.sdk.Room

Public Member Functions

void postIframeMessage (String string)
 
void postIframeMessage (WhiteObject object)
 
void getScenePathType (String path, final Promise< WhiteScenePathType > promise)
 
void getScene (String path, final Promise< Scene > promise)
 
void getEntireScenes (final Promise< Map< String, Scene[]> > promise)
 
void refreshViewSize ()
 
void scaleIframeToFit ()
 
void scalePptToFit ()
 
void scalePptToFit (AnimationMode mode)
 
void addMagixEventListener (String eventName, EventListener eventListener)
 
void addHighFrequencyEventListener (String eventName, FrequencyEventListener eventListener, Integer fireInterval)
 
void removeMagixEventListener (String eventName)
 
void convertToPointInWorld (double x, double y, final Promise< Point > promise)
 
void setCameraBound (CameraBound bound)
 
void setBackgroundColor (@ColorInt int intColor)
 
int getBackgroundColor ()
 
void getScenePreviewImage (String scenePath, final Promise< Bitmap > promise)
 
void getSceneSnapshotImage (String scenePath, final Promise< Bitmap > promise)
 
void disableCameraTransform (Boolean disable)
 
void moveCamera (CameraConfig camera)
 
void moveCameraToContainer (RectangleConfig rectangle)
 

Protected Member Functions

void post (Runnable runnable)
 

Protected Attributes

final JsBridgeInterface bridge
 
String uuid
 
int densityDpi
 

Static Protected Attributes

static final Gson gson = new Gson()
 

Detailed Description

The Displayer class, which is the parent class of the Room class. The Room class can inherit the methods of the Displayer class.

Member Function Documentation

◆ postIframeMessage() [1/2]

void com.herewhite.sdk.Displayer.postIframeMessage ( String  string)

Sends message in string format to the iframe plugin.

Since
2.11.4
Parameters
stringThe message in string format.

◆ postIframeMessage() [2/2]

void com.herewhite.sdk.Displayer.postIframeMessage ( WhiteObject  object)

Sends message in key-value format to the iframe plugin.

Since
2.11.4
Parameters
objectThe message in key-value format, which must be a subclass of WhiteObject.

◆ getScenePathType()

void com.herewhite.sdk.Displayer.getScenePathType ( String  path,
final Promise< WhiteScenePathType promise 
)

Gets the type of the scene path.

This method returns the scene type for the scene path that you specify in the method.

Parameters
pathThe path of the scene.
promiseThe Promise<WhiteScenePathType> interface instance. See Promise. You can get the call result of getScenePathType through this interface:
  • The global state of the room, if the method call succeeds. See WhiteScenePathType.
  • An error message, if the method call fails.

◆ getScene()

void com.herewhite.sdk.Displayer.getScene ( String  path,
final Promise< Scene promise 
)

Gets the information about a specified scene.

Parameters
pathThe path of a scene. Ensure the scene path stars with / and consists of the scene directory and scene name. For example, /math/classA.
promiseThe Promise<Scene> interface instance. See Promise. You can get the call result of getScene through this interface:
  • The information about the specified scene, if the method call succeeds. See Scene.
  • An error message, if the method call fails.

◆ getEntireScenes()

void com.herewhite.sdk.Displayer.getEntireScenes ( final Promise< Map< String, Scene[]> >  promise)

Gets information about all scenes in the room.

Parameters
promiseThe Promise<Map<String, Scene[]>> interface instance. See Promise. You can get the call result of getEntireScenes through this interface:
  • The information about all scenes in the room, if the method call succeeds.
  • An error message, if the method call fails.

◆ refreshViewSize()

void com.herewhite.sdk.Displayer.refreshViewSize ( )

Refreshes the whiteboard view.

When the WhiteboardView changes, you need to call this method to refresh the whiteboard view.

◆ scaleIframeToFit()

void com.herewhite.sdk.Displayer.scaleIframeToFit ( )

Adjusts the view to ensure the complete display of the HTML5 file.

Since
2.12.13

◆ scalePptToFit() [1/2]

void com.herewhite.sdk.Displayer.scalePptToFit ( )

Adjusts the view in Continuous mode to ensure the complete display of the PPT slide.

Since
2.4.22

◆ scalePptToFit() [2/2]

void com.herewhite.sdk.Displayer.scalePptToFit ( AnimationMode  mode)

Adjusts the view in the specified mode to ensure the complete display of the PPT slide.

Since
2.4.28
Parameters
modeThe animation mode for adjusting the view. See AnimationMode.

◆ addMagixEventListener()

void com.herewhite.sdk.Displayer.addMagixEventListener ( String  eventName,
EventListener  eventListener 
)

Adds a listener for a customized event.

You can receive the customized event callback after a successful call of this method.

Note
The SDK triggers only one callback for customized events with the same name.
Parameters
eventNameThe name of the event.
eventListenerThe customized event callback. See EventListener. If you add multiple callbacks for the same event, the callback added later overrides the one added earlier.

◆ addHighFrequencyEventListener()

void com.herewhite.sdk.Displayer.addHighFrequencyEventListener ( String  eventName,
FrequencyEventListener  eventListener,
Integer  fireInterval 
)

Adds a listener for a customized high-frequency event.

You can receive the customized event callback after a successful call of this method.

Note
The SDK triggers only one callback for customized events with the same name.
Parameters
eventNameThe name of the event.
eventListenerThe customized event callback. See FrequencyEventListener. If you add multiple callbacks for the same event, the callback added later overrides the one added earlier.
fireIntervalThe interval (ms) at which the SDK triggers the callback. The minimum interval is 500 ms. The SDK automatically adjusts values smaller than 500 to 500.

◆ removeMagixEventListener()

void com.herewhite.sdk.Displayer.removeMagixEventListener ( String  eventName)

Removes a listener for a customized event.

Parameters
eventNameThe name of the event.

◆ convertToPointInWorld()

void com.herewhite.sdk.Displayer.convertToPointInWorld ( double  x,
double  y,
final Promise< Point promise 
)

Converts the coordinates of a point on the whiteboard.

This method converts the coordinates of the Android internal coordinate system (taking the upper left corner as the origin) to the coordinates of the world coordinate system (taking the center of the initial whiteboard as the origin).

Parameters
xThe X coordinate of the point in the Android internal coordinate system.
yThe Y coordinate of the point in the Android internal coordinate system.
promiseThe Promise<Point> interface instance. See Promise. You can get the call result of convertToPointInWorld through this interface:
  • The new coordinates, if the method call succeeds. See Point.
  • An error message, if the method call fails.

◆ setCameraBound()

void com.herewhite.sdk.Displayer.setCameraBound ( CameraBound  bound)

Sets the boundary of the local user's view.

Since
2.5.0
Parameters
boundThe boundary of the view. See CameraBound.

◆ setBackgroundColor()

void com.herewhite.sdk.Displayer.setBackgroundColor ( @ColorInt int  intColor)

Sets the background color of the whiteboard.

Since
2.4.14
Deprecated:
This method is deprecated. Use the Android native method setBackgroundColor instead.
Note
This method applies to the local user's whiteboard only and does not change the background color of other users' whiteboards.
Parameters
intColorThe background color of the whiteboard in RGBA hex value. The alpha channel does not have a value that makes the whiteboard transparent.

◆ getBackgroundColor()

int com.herewhite.sdk.Displayer.getBackgroundColor ( )

Gets the background color of the whiteboard.

Since
2.4.0
Deprecated:
This method is deprecated.
Returns
The background color of the whiteboard in RGB hex value.

◆ getScenePreviewImage()

void com.herewhite.sdk.Displayer.getScenePreviewImage ( String  scenePath,
final Promise< Bitmap >  promise 
)

Gets the preview of the specified scene.

Since
2.3.0
Parameters
scenePathThe path of the scene.
promiseThe Promise<Bitmap> interface instance. See Promise. You can get the call result of getScenePreviewImage through this interface:
  • The preview of the specified scene, if the method call succeeds.
  • An error message, if the method call fails.

◆ getSceneSnapshotImage()

void com.herewhite.sdk.Displayer.getSceneSnapshotImage ( String  scenePath,
final Promise< Bitmap >  promise 
)

Gets the screenshot of the specified scene.

Since
2.3.0
Note
If the scene displays an image or dynamic PPT slide, ensure that the storage server of the image or the PPT slide supports cross-origin resource sharing; otherwise, the image or PPT slide may not be shown in the generated screenshot.
Parameters
scenePathThe path of the scene.
promiseThe Promise<Bitmap> interface instance. See Promise. You can get the call result of getSceneSnapshotImage through this interface:
  • The screenshot of the scene, if the method call succeeds.
  • An error message, if the method call fails.

◆ disableCameraTransform()

void com.herewhite.sdk.Displayer.disableCameraTransform ( Boolean  disable)

Disables the user from adjusting the view.

Since
2.11.0

This method disables the user from moving or zooming the view through touch-screen gestures.

Parameters
disableWhether to disable the user from adjusting the view:
  • true: Disable the user from adjusting the view.
  • false: (Default) Enable the user to adjust the view.

◆ moveCamera()

void com.herewhite.sdk.Displayer.moveCamera ( CameraConfig  camera)

Adjusts the view.

Since
2.2.0
Parameters
cameraSettings of the view. See CameraConfig.

◆ moveCameraToContainer()

void com.herewhite.sdk.Displayer.moveCameraToContainer ( RectangleConfig  rectangle)

Adjusts the view to ensure the complete display of the view rectangle.

Since
2.2.0
Parameters
rectangleSettings of the view rectangle. See RectangleConfig.