Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2013-2014 Erwin Müller <erwin.mueller@deventm.org>
   *
   * This file is part of prefdialog-misc-swing.
   *
   * prefdialog-misc-swing is free software: you can redistribute it and/or modify it
   * under the terms of the GNU Lesser General Public License as published by the
   * Free Software Foundation, either version 3 of the License, or (at your
   * option) any later version.
  *
  * prefdialog-misc-swing is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  * details.
  *
  * You should have received a copy of the GNU Lesser General Public License
  * along with prefdialog-misc-swing. If not, see <http://www.gnu.org/licenses/>.
  */
 package com.anrisoftware.prefdialog.miscswing.docks.api;
 
 import java.io.File;
 
 
Layouts the child windows inside and outside the working area.

Example:

 dock = dock.createDock(frame);
 frame.add(dock.getAWTComponent(), BorderLayout.CENTER);
 dock.applyLayout(defaultLayout);
 dock.addViewDock(viewDock);
 dock.addEditorDock(editor);
 dock.addEditorDock(editor);
 

Author(s):
Erwin Mueller, erwin.mueller@deventm.org
Since:
3.0
 
 public interface Dock {

Creates the dock with the specified frame.

AWT Thread

Should be called in the AWT thread.

Parameters:
frame the javax.swing.JFrame or null.
Returns:
this Dock.
 
 	Dock createDock(JFrame frame);

Returns the AWT component of the dock to be added in a container.

Returns:
the java.awt.Component.
 
Adds a dock in the outside of the working area.

AWT Threading

Should be done in the AWT thread.

Parameters:
dock the ViewDockWindow.
 
 	void addViewDock(ViewDockWindow dock);

Adds a dock in the working area.

AWT Threading

Should be done in the AWT thread.

Parameters:
dock the EditorDockWindow.
 
Apply the layout.

AWT Threading

Should be done in the AWT thread.

Parameters:
layout the LayoutTask that applies the layout.
	void applyLayout(LayoutTask layout);

Saves the current layout under the specified name.

Parameters:
name the name of the perspective.
file the java.io.File file where to save the layout.
Throws:
java.io.IOException if there was I/O error saving the layout.
	void saveLayout(String nameFile filethrows IOException;

Saves the current layout under the specified name.

Parameters:
name the name of the layout.
stream the java.io.OutputStream stream where to save the layout.
Throws:
java.io.IOException if there was I/O error saving the layout.
	void saveLayout(String nameOutputStream streamthrows IOException;

Loads the previously saved layout with the specified name.

Parameters:
name the name of the layout.
file the java.io.File file from where to load the layout.
listeners optionally, java.beans.PropertyChangeListener listeners that are informed when the layout have been loaded and set.
Throws:
java.io.IOException if there was I/O error loading the layout.
	void loadLayout(String nameFile filePropertyChangeListener... listeners)
			throws IOException;

Loads the previously saved layout with the specified name.

Parameters:
name the name of the layout.
stream the java.io.InputStream stream from where to load the layout.
listeners optionally, java.beans.PropertyChangeListener listeners that are informed when the layout have been loaded and set.
Throws:
java.io.IOException if there was I/O error loading the layout.
	void loadLayout(String nameInputStream stream,
			PropertyChangeListener... listenersthrows IOException;

Returns the current active layout.

Returns:
the LayoutTask.
Sets a theme.

AWT Threading

Should be done in the AWT thread.

Parameters:
name the theme name.
	void setTheme(String name);

Adds a new listener that is informed of layout changes.

Parameters:
listener the LayoutListener.
Focus the specified editor dock.

Parameters:
dock the EditorDockWindow.
Removes the listener that was informed of layout changes.

Parameters:
listener the LayoutListener.
Adds a new listener that is informed of changes of the docks.

Parameters:
listener the javax.swing.event.ChangeListener.
Removes the listener that was informed of changes of the docks.

Parameters:
listener the javax.swing.event.ChangeListener.
New to GrepCode? Check out our FAQ X