Skip to content
Levi Webb edited this page Sep 17, 2015 · 4 revisions

Any code called outside of the ca.jarcode.consoles.api package is not guaranteed to provide any sort of version compatibility, and the method/class structure may change at any time. It is recommended that you only use API classes and functionality.

You can build strictly against the API by only using the consoles-api maven module, which is the recommended way to use this API.

Class structure:

  • Every Canvas belongs to a Console, so when you create your own Console, it has a canvas of its own.

  • The Canvas, CanvasComponent, and CanvasContainer interfaces cannot be extended to overload methods. These interfaces provide abstraction for the internal code, and will throw lots of ClassCastExceptions if you try to implement these yourself. Use CustomComponent and CustomContainer to overload methods with your own functionality.

  • Every CanvasContainer can be assumed to be a CanvasComponent as well. You will need to cast these yourself, they are both interfaces, not abstract classes.

  • WrappedComponent, RootComponent and PreparedComponent are interfaces for how consoles-core treats various API components. Even though they are in the API module, they should not be implemented by any of your classes.

  • Various internal components have API wrappers for them, such as CanvasDialog (dialog boxes that resize to fit child components), CanvasTextArea (a standard, auto-scrolling text area) and CanvasFeed (an extension of a text area to handle input/output streams and a prompt).