JHotDraw 7.0.6

org.jhotdraw.draw
Interface DrawingEditor

All Known Implementing Classes:
DefaultDrawingEditor

public interface DrawingEditor

DrawingEditor defines the interface for coordinating the different objects that participate in a drawing editor.

For applications with a single document interface (SDI) there is typically one DrawingEditor instance per document window. So that each window can have its own toolbars and drawing palettes.

For applications with a Windows-style multiple document interface (MDI) there is typically one DrawingEditor instance per parent window. All document windows within a parent window share the toolbars and drawing palettes provided be the parent window.

For applications with a Mac OS X-style application document interface (OSX) there is typically a single DrawingEditor instance for the application. All document windows within the application share a single set of toolbars and drawing palettes.


Method Summary
 void add(DrawingView view)
          Adds a drawing view to the editor.
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
           
 void applyDefaultAttributesTo(Figure f)
          Applies the default attributes to the specified figure.
 DrawingView findView(java.awt.Container c)
          Finds a drawing view.
 java.lang.Object getDefaultAttribute(AttributeKey key)
          Gets a default attribute from the editor.
 java.util.Collection<DrawingView> getDrawingViews()
          Gets all drawing views associated with this editor.
 DrawingView getFocusedView()
          Gets the editor's focused view.
 Tool getTool()
          Gets the current tool.
 DrawingView getView()
          Gets the editor's active drawing view.
 boolean isEnabled()
          Gets the enabled state of the drawing editor.
 void remove(DrawingView view)
          Removes a drawing view from the editor.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
           
 void setCursor(java.awt.Cursor c)
          Sets the cursor on the view(s) of the drawing editor.
 void setDefaultAttribute(AttributeKey key, java.lang.Object value)
          Sets a default attribute of the editor.
 void setEnabled(boolean newValue)
          Sets the enabled state of the drawing editor.
 void setTool(Tool t)
          Calls deactivate on the previously active tool of this drawing editor.
 void setView(DrawingView newValue)
          Sets the editor's active drawing view.
 

Method Detail

add

void add(DrawingView view)
Adds a drawing view to the editor. The editor invokes addNotify on the view, and it registers its tool as an event listener on the view.


remove

void remove(DrawingView view)
Removes a drawing view from the editor. The editor invokes removeNotify on the view, and it unregisters its tool on the view.


getDrawingViews

java.util.Collection<DrawingView> getDrawingViews()
Gets all drawing views associated with this editor.


getView

DrawingView getView()
Gets the editor's active drawing view. This can be null, if the editor has no views.


setView

void setView(DrawingView newValue)
Sets the editor's active drawing view. This can be set to null, if the editor has no views.


getFocusedView

DrawingView getFocusedView()
Gets the editor's focused view. This can be null, if the editor has no views.


setTool

void setTool(Tool t)
Calls deactivate on the previously active tool of this drawing editor. Calls activate on the provided tool. Forwards all mouse, mouse moation and keyboard events that occur on the DrawingView to the provided tool.


getTool

Tool getTool()
Gets the current tool.


setCursor

void setCursor(java.awt.Cursor c)
Sets the cursor on the view(s) of the drawing editor.


findView

DrawingView findView(java.awt.Container c)
Finds a drawing view. This is used by Tool to identify the view of which it has received an event.


setDefaultAttribute

void setDefaultAttribute(AttributeKey key,
                         java.lang.Object value)
Sets a default attribute of the editor. The default attribute will be used by creation tools, to create a new figure.


getDefaultAttribute

java.lang.Object getDefaultAttribute(AttributeKey key)
Gets a default attribute from the editor. The default attribute will be used by creation tools, to create a new figure.


applyDefaultAttributesTo

void applyDefaultAttributesTo(Figure f)
Applies the default attributes to the specified figure.


setEnabled

void setEnabled(boolean newValue)
Sets the enabled state of the drawing editor. This is a bound property.


isEnabled

boolean isEnabled()
Gets the enabled state of the drawing editor.


addPropertyChangeListener

void addPropertyChangeListener(java.beans.PropertyChangeListener listener)

removePropertyChangeListener

void removePropertyChangeListener(java.beans.PropertyChangeListener listener)

Copyright 1996-2006 © JHotDraw.org