This document describes suggestion of the new Designer module API. It approaches from the minimalistic version, keeping in mind, that as the implementation will go further, the other methods will be defined and consequently implemented.
Now the Designer interface.
public void addSelectionListener(SelectionListener);
public void removeSelectionListener(SelectionListener);
TBD Further refinements or possible enhancements will be coming as we will progress in the implementation.
Summary of the API in tables:
| DesignerFactory class | |
|---|---|
| Method Name | Purpose of the Method |
| public Designer createDesigner(BrowserType) | Factory method creating Designer component instances of specified browser type. |
| Designer interface | |
|---|---|
| Method Name | Purpose of the Method |
| public JComponent getComponent() | Gets Swing component representing the browser component with editing layer on top of it. |
| public org.w3c.dom.Document createDocument(InputStream) | Creates DOM document based on provided input stream. This could be overloaded by other parameters, or also provide other ways how to get to the DOM Document. |
| public Point getLocation(Element) | Gets location of the element on the canvas. |
| public Rectangle\\ getBoxRectangles(Element) | Gets rectangles of all boxes representing the element. |
| public Element getElementAt(Point) | Gets element located at specified point on canvas. |
| public Element\\ getSelected() | Gets selected elements. |
| public void setSelected(Element\\) | Sets selected elements. |
| public void addSelectionListener(SelectionListener) | Adds selection listener. Note the selection listener API needs to be specified or used existing Swing API listener instead. |
| public void removeSelectionListener(SelectionListener) | Removes selection listener. Note the selection listener API needs to be specified or used existing Swing API listener instead. |