123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- /*
- * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack, Gregory Holmes
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
- package com.dmdirc.ui.interfaces;
-
- import com.dmdirc.FrameContainer;
- import com.dmdirc.util.StringTranscoder;
- import com.dmdirc.config.ConfigManager;
-
- import java.beans.PropertyVetoException;
-
- import javax.swing.Icon;
-
- /**
- * The Window interface specifies common methods that should be implemented
- * by all windows. It is assumed that all windows have a main text area.
- */
- public interface Window {
-
- /**
- * Formats the arguments using the Formatter, then adds the result to the
- * main text area.
- *
- * @param messageType The type of this message
- * @param args The arguments for the message
- */
- void addLine(String messageType, Object... args);
-
- /**
- * Formats the arguments using the Formatter, then adds the result to the
- * main text area.
- *
- * @param messageType The type of this message
- * @param args The arguments for the message
- */
- void addLine(StringBuffer messageType, Object... args);
-
- /**
- * Adds the specified raw line to the window, without using a formatter.
- *
- * @param line The line to be added
- * @param timestamp Whether or not to display the timestamp for this line
- */
- void addLine(final String line, final boolean timestamp);
-
- /**
- * Clears the main text area of the command window.
- */
- void clear();
-
- /**
- * Retrieves the config manager for this command window.
- *
- * @return This window's config manager
- */
- ConfigManager getConfigManager();
-
- /**
- * Retrieves the container that owns this command window.
- *
- * @return The container that owns this command window.
- */
- FrameContainer getContainer();
-
- /**
- * Determines if the current window is visible.
- *
- * @return boolean visibility
- */
- boolean isVisible();
-
- /**
- * Sets the visibility of this window.
- *
- * @param isVisible Whether the window should be visible or not
- */
- void setVisible(boolean isVisible);
-
- /**
- * Retrives the current title of this window.
- *
- * @return This window's title
- */
- String getTitle();
-
- /**
- * Determines if this frame is currently maximised.
- *
- * @return true if the frame is maximised, false otherwise
- */
- boolean isMaximum();
-
- /**
- * Sets the maximised state of this window.
- *
- * @param b true if the frame should be maximised, false otherwise
- * @throws PropertyVetoException if the change is vetoed
- */
- void setMaximum(boolean b) throws PropertyVetoException;
-
- /**
- * Sets the title of this window.
- *
- * @param title The new title to be used.
- */
- void setTitle(String title);
-
- /**
- * Opens this window.
- */
- void open();
-
- /**
- * Sets the icon used by this window, if the GUI supports icons.
- *
- * @param icon The icon to be used
- */
- void setFrameIcon(Icon icon);
-
- /**
- * Returns the transcoder that is being used by the UI.
- *
- * @return This window's transcoder
- */
- StringTranscoder getTranscoder();
-
- }
|