001: /*
002: * @(#)Contour.java
003: *
004: * Copyright 2002 JIDE Software Inc. All rights reserved.
005: */
006: package com.jidesoft.swing;
007:
008: import javax.swing.*;
009: import java.awt.*;
010:
011: /**
012: * A <code>Contour</code> is a lightweight component which only paints the outline
013: * of component when dragged. It is also used as a placeholder for some information during dragging.
014: * <p/>
015: * Usually <code>Contour</code> is added to {@link JLayeredPane} of a {@link RootPaneContainer}
016: * so that it looks like floating above other windows.
017: * <p/>
018: * Notes: this class has to be public so that JIDE can use it in different packages,
019: * not meant to release to end user as a public API. JIDE will not gurantee the class
020: * will remain as it is.
021: */
022: public interface IContour {
023:
024: public Rectangle getBounds();
025:
026: public boolean isLightweight();
027:
028: public void setBounds(Rectangle r);
029:
030: public void setBounds(int x, int y, int width, int height);
031:
032: public int getTabHeight();
033:
034: /**
035: * Sets the tab height.
036: *
037: * @param tabHeight
038: */
039: public void setTabHeight(int tabHeight);
040:
041: /**
042: * Returns true if the contour is in tab-dock mode.
043: *
044: * @return true if tab-docking; false otherwise
045: */
046: public boolean isTabDocking();
047:
048: /**
049: * Sets the tab-docking mode.
050: *
051: * @param tabDocking new mode
052: */
053: public void setTabDocking(boolean tabDocking);
054:
055: /**
056: * Gets the side of the tab.
057: *
058: * @return the side of the tab
059: */
060: public int getTabSide();
061:
062: /**
063: * Sets the side of the tab.
064: *
065: * @param tabSide
066: */
067: public void setTabSide(int tabSide);
068:
069: /**
070: * Returns true if the contour is in floating mode.
071: *
072: * @return true if floating; false otherwise
073: */
074: public boolean isFloating();
075:
076: /**
077: * Sets the floating mode.
078: *
079: * @param floating new mode
080: */
081: public void setFloating(boolean floating);
082:
083: /**
084: * Gets the attached component of this contour.
085: *
086: * @return the attached component
087: */
088: public Component getAttachedComponent();
089:
090: /**
091: * Sets the attached components.
092: *
093: * @param attachedComponent attached component to be set
094: */
095: public void setAttachedComponent(Component attachedComponent);
096:
097: /**
098: * Gets the side of the attached component which the contour is attached to.
099: *
100: * @return side the attached side
101: */
102: public int getAttachedSide();
103:
104: /**
105: * Sets the side of the attached component which the contour is attached to.
106: *
107: * @param attachedSide the new attached side to be set
108: */
109: public void setAttachedSide(int attachedSide);
110:
111: /**
112: * When you dragged a component, several other components could be dragged.
113: * For example, if user drags on title bar of FrameContainer, all components in the
114: * FrameContainer are considered as dragged. If user drags on tab, only selected one
115: * is dragged.
116: *
117: * @return <code>true</code> if all dragged components are affected; <code>false</code> otherwise.
118: */
119: public boolean isSingle();
120:
121: /**
122: * Sets the value of single.
123: *
124: * @param single <code>true</code> if all dragged components are affected; <code>false</code> otherwise.
125: */
126: public void setSingle(boolean single);
127:
128: /**
129: * Checks if docking is alloed.
130: *
131: * @return <code>true</code> if docking is allowed; <code>false</code> otherwise.
132: */
133: public boolean isAllowDocking();
134:
135: /**
136: * Sets the value of docking.
137: *
138: * @param allowDocking <code>true</code> if docking is allowed; <code>false</code> otherwise.
139: */
140: public void setAllowDocking(boolean allowDocking);
141:
142: public Container getRelativeContainer();
143:
144: public void setRelativeContainer(Container relativeContainer);
145:
146: /**
147: * Gets saved X position of contour before it's hidden.
148: *
149: * @return saved X position
150: */
151: public int getSaveX();
152:
153: /**
154: * Gets saved Y position of contour before it's hidden.
155: *
156: * @return saved Y position
157: */
158: public int getSaveY();
159:
160: /**
161: * Gets saved mouse modifier before the contour is hidden.
162: *
163: * @return saved mouse modifier
164: */
165: public int getSaveMouseModifier();
166:
167: /**
168: * Gets saved dragged component before the contour is hidden.
169: *
170: * @return saved dragged component
171: */
172: public JComponent getSaveDraggedComponent();
173:
174: /**
175: * Stores information before the contour is hidden. Those information
176: * will be used to restore when the contour is set visible again.
177: *
178: * @param comp the dragged component
179: * @param saveX X position of the contour
180: * @param saveY Y position of the contour
181: * @param saveMouseModifier mouse modifier in the MouseEvent
182: */
183: public void setDraggingInformation(JComponent comp, int saveX,
184: int saveY, int saveMouseModifier);
185:
186: public void cleanup();
187:
188: // private Screen _screen;
189: // private Container _savedContainer;
190:
191: /**
192: * Makes the component visible or invisible.
193: * Overrides <code>Component.setVisible</code>.
194: *
195: * @param aFlag true to make the component visible; false to
196: * make it invisible
197: */
198: public void setVisible(boolean aFlag);
199:
200: /**
201: * Determines whether this component should be visible when its
202: * parent is visible. Components are
203: * initially visible, with the exception of top level components such
204: * as <code>Frame</code> objects.
205: *
206: * @return <code>true</code> if the component is visible,
207: * <code>false</code> otherwise
208: * @see #setVisible
209: * @since JDK1.0
210: */
211: public boolean isVisible();
212:
213: public void setGlassPane(Component glassPane);
214:
215: public Component getGlassPane();
216:
217: public void setChangeCursor(boolean changeCursor);
218: }
|